dotfiles/config/vim/vimconfig.vim

85 lines
1.5 KiB
VimL
Raw Normal View History

2019-04-28 04:27:36 +02:00
""" VIM SETTINGS """
2019-06-11 06:28:58 +02:00
" From https://www.hillelwayne.com/post/intermediate-vim/
2019-04-28 04:27:36 +02:00
set encoding=utf-8
set title
set number
set ruler
set wrap
set scrolloff=10
set ignorecase
set smartcase
2019-10-17 12:44:30 +02:00
set gdefault
2019-06-11 06:28:58 +02:00
if has('nvim')
set inccommand=nosplit " Shows you in realtime what changes your ex command should make.
endif
2019-04-28 04:27:36 +02:00
set incsearch
set hlsearch
set tabstop=4
set shiftwidth=4
set expandtab
set visualbell
set noerrorbells
set backspace=indent,eol,start
set hidden
set updatetime=250
2019-06-11 06:28:58 +02:00
set lazyredraw " Do not redraw screen in the middle of a macro. Makes them complete faster.
2019-04-28 04:27:36 +02:00
set cursorcolumn
set splitbelow
2019-06-11 06:28:58 +02:00
" Turn off relativenumber only for insert mode.
if has('nvim')
2019-07-08 07:57:29 +02:00
set relativenumber
2019-06-11 06:28:58 +02:00
augroup every
autocmd!
au InsertEnter * set norelativenumber
au InsertLeave * set relativenumber
augroup END
endif
2019-04-28 04:27:36 +02:00
syntax enable
" From http://stackoverflow.com/a/5004785/2766106
set list
set listchars=tab:╾╌,trail,extends:↦,precedes:↤,nbsp:_
set showbreak=
filetype on
filetype plugin on
filetype indent on
set wildmode=longest,list
2020-05-03 13:24:45 +02:00
set wildmenu
2019-04-28 04:27:36 +02:00
set showcmd
2020-05-25 09:05:56 +02:00
" Close the file explorer once you select a file
let g:netrw_fastbrowse = 0
2019-04-28 04:27:36 +02:00
" Allow saving of files as sudo when I forgot to start vim using sudo.
" From https://stackoverflow.com/a/7078429
cmap w!! w !sudo tee > /dev/null %
imap jk <Esc>
vmap <Enter> <Esc>
nmap <Enter> o<Esc>
nmap <C-H> :bp<CR>
nmap <C-L> :bn<CR>
2020-05-25 09:05:56 +02:00
nmap <C-K> kkkkkkkkkkkkkkkkkkkkk
nmap <C-J> jjjjjjjjjjjjjjjjjjjjj
2019-04-28 04:27:36 +02:00
2019-10-17 12:44:30 +02:00
" \s to replace globally the word under the cursor
nnoremap <Leader>s :%s/\<<C-r><C-w>\>/