set encoding=utf8 scriptencoding utf8 lang en_US.UTF-8 " use space as key let mapleader=" " set nu set relativenumber " syntax highlighting syntax on filetype plugin indent on set backspace=indent,eol,start " indentation set tabstop=4 set softtabstop=4 set shiftwidth=4 set expandtab set smartindent set autoindent " copy paste clipboard set clipboard=unnamed " highlight current line set cursorline " searching set incsearch set ignorecase set smartcase set nohlsearch " display title of current file in terminal title bar set title " allow hidden buffers set hidden " dont wrap long lines set nowrap " disable swaps and backups set noswapfile set nobackup set nowritebackup " start scrolling when 8 lines left set scrolloff=8 " show sign column set signcolumn=yes " show the colorcolumn set colorcolumn=80 " :sp and :vsp should split below and to the right set splitbelow set splitright " avoid delays when typing set updatetime=50 " enable mouse support set mouse=a " shows a more advanced command-line completion menu set wildmenu " Modifies the auto-complete menu. See :h completeopt set completeopt="noinsert,menuone,noselect" " show whitespace characters set list lcs=tab:>\ ,trail:~,precedes:<,space:\ ,nbsp:× " set correct filetype for terraform files autocmd BufRead,BufNewFile *.tf,*.tfvars set filetype=terraform " set correct comment string for powershell files autocmd FileType ps1 setlocal commentstring=#\ %s " --------------------------------- " --- KEYBINDINGS " -------------------------------- " open file explorer nnoremap pv :Ex " copy the whole file and stay where you are nnoremap yy ggVGy " move visual line(s) up and down vnoremap J :m '>+1gv=gv vnoremap K :m '<-2gv=gv " move line up/down nnoremap :m-2 nnoremap :m+1 " keeps search in the middle (n=next, N=previous) nnoremap n nzzzv nnoremap N Nzzzv " keeps half page up/down in the middle nnoremap zz nnoremap zz " delete highlighted word/line into void and keeps the pasted value " in default registry so you can paste many times xnoremap p "_dp " delete to void nnoremap d "_d vnoremap d "_d " fzf nnoremap :GFiles nnoremap ff :Files nnoremap fg :Ag nnoremap ffg :Rg nnoremap b :Buffers " reload file if changes from outside autocmd FocusGained,BufEnter * :checktime " avoid human error cabbr W w cabbr Wq wq cabbr Q q cabbr E e " ---------------------- " --- PLUGINS " ---------------------- call plug#begin() Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } Plug 'junegunn/fzf.vim' Plug 'jremmen/vim-ripgrep' Plug 'tpope/vim-commentary' Plug 'tpope/vim-surround' Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']} call plug#end() " ---------------------- " --- THEME " ---------------------- set background=dark colorscheme habamax " highlight extra whitespace highlight ExtraWhitespace ctermbg=red guibg=red autocmd BufWinEnter * match ExtraWhitespace /\s\+$/ autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@