2021-05-30 19:10:28 +00:00
|
|
|
set nocompatible " be iMproved, required
|
|
|
|
filetype indent plugin on " required
|
|
|
|
|
|
|
|
set modeline
|
|
|
|
set modelines=1
|
|
|
|
set nowrap
|
|
|
|
|
|
|
|
set viminfo='100,<100,s20 " vim file history
|
|
|
|
|
|
|
|
set hidden
|
|
|
|
|
|
|
|
set shiftwidth=2
|
2024-04-19 08:56:31 +00:00
|
|
|
set tabstop=2
|
2021-05-30 19:10:28 +00:00
|
|
|
set number
|
|
|
|
set relativenumber
|
2022-11-22 11:31:45 +00:00
|
|
|
set mouse=
|
2024-04-19 08:56:31 +00:00
|
|
|
set listchars=tab:→\ ,nbsp:␣,trail:␣,extends:⟩,precedes:⟨
|
|
|
|
set list
|
2021-05-30 19:10:28 +00:00
|
|
|
|
2023-12-13 10:53:16 +00:00
|
|
|
set autoindent
|
|
|
|
set smartindent
|
|
|
|
|
2021-05-30 19:10:28 +00:00
|
|
|
set undolevels=1000
|
|
|
|
set undoreload=10000
|
|
|
|
|
|
|
|
set updatetime=300
|
|
|
|
|
|
|
|
let mapleader = " "
|
|
|
|
|
|
|
|
nmap <c-s> :w<CR>
|
|
|
|
imap <c-s> <Esc>:w<CR>
|
|
|
|
vmap <c-s> <Esc><c-s>gv
|
|
|
|
|
|
|
|
noremap <leader>y "+y
|
|
|
|
noremap <leader>p "+p
|
|
|
|
|
|
|
|
noremap i <Up>
|
|
|
|
noremap j <Left>
|
|
|
|
noremap k <Down>
|
|
|
|
noremap h i
|
|
|
|
|
|
|
|
vnoremap K L
|
|
|
|
vnoremap I H
|
|
|
|
vnoremap H I
|
|
|
|
|
|
|
|
nnoremap K L
|
|
|
|
nnoremap I H
|
|
|
|
nnoremap H I
|
|
|
|
|
2024-02-03 12:18:49 +00:00
|
|
|
map <leader>wi :wincmd k<CR>
|
|
|
|
map <leader>wj :wincmd h<CR>
|
|
|
|
map <leader>wk :wincmd j<CR>
|
|
|
|
map <leader>wl :wincmd l<CR>
|
2024-02-18 20:18:02 +00:00
|
|
|
map <leader>wq :wincmd q<CR>
|
2024-02-03 12:18:49 +00:00
|
|
|
|
|
|
|
map <leader>wI :wincmd K<CR>
|
|
|
|
map <leader>wJ :wincmd H<CR>
|
|
|
|
map <leader>wK :wincmd J<CR>
|
|
|
|
map <leader>wL :wincmd L<CR>
|
|
|
|
|
2021-05-30 19:10:28 +00:00
|
|
|
" replay macro for each line of a visual selection
|
|
|
|
xnoremap @q :normal @q<CR>
|
|
|
|
xnoremap @@ :normal @@<CR>
|
|
|
|
|
|
|
|
" reselect and re-yank any text that is pasted in visual mode
|
|
|
|
xnoremap p pgvy
|
|
|
|
|
|
|
|
" Escape overwrite
|
|
|
|
inoremap jj <Esc>
|
|
|
|
|
|
|
|
" Open new buffer
|
2024-08-18 22:07:22 +00:00
|
|
|
nmap <leader>bn :enew<cr>
|
2021-05-30 19:10:28 +00:00
|
|
|
nmap <leader>l :bnext<CR>
|
2024-08-18 22:07:22 +00:00
|
|
|
nmap <leader>bn :bnext<CR>
|
2021-05-30 19:10:28 +00:00
|
|
|
nmap <leader>j :bprevious<CR>
|
2024-08-18 22:07:22 +00:00
|
|
|
nmap <leader>bp :bprevious<CR>
|
2021-05-30 19:10:28 +00:00
|
|
|
nmap <leader>q :bp <BAR> bd #<CR>
|
2024-08-18 22:07:22 +00:00
|
|
|
nmap <leader>bq :bp <BAR> bd #<CR>
|
2021-05-30 19:10:28 +00:00
|
|
|
|
|
|
|
" Clear quickfix shortcut
|
|
|
|
nmap <Leader>c :ccl<CR>
|
|
|
|
|
|
|
|
" Remember cursor position
|
|
|
|
" Vim jumps to the last position when reopening a file
|
|
|
|
if has("autocmd")
|
|
|
|
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
|
|
|
|
endif
|