forked from pub-solar/os
91 lines
1.6 KiB
VimL
91 lines
1.6 KiB
VimL
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 expandtab
|
|
set shiftwidth=2
|
|
set number
|
|
set relativenumber
|
|
set mouse=
|
|
set autoindent
|
|
set smartindent
|
|
|
|
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
|
|
|
|
map <leader>wi :wincmd k<CR>
|
|
map <leader>wj :wincmd h<CR>
|
|
map <leader>wk :wincmd j<CR>
|
|
map <leader>wl :wincmd l<CR>
|
|
|
|
map <leader>wI :wincmd K<CR>
|
|
map <leader>wJ :wincmd H<CR>
|
|
map <leader>wK :wincmd J<CR>
|
|
map <leader>wL :wincmd L<CR>
|
|
|
|
" 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
|
|
nmap <leader>T :enew<cr>
|
|
|
|
" Move to the next buffer
|
|
nmap <leader>l :bnext<CR>
|
|
|
|
" Move to the previous buffer
|
|
nmap <leader>j :bprevious<CR>
|
|
|
|
" Close the current buffer and move to the previous one
|
|
" This replicates the idea of closing a tab
|
|
nmap <leader>q :bp <BAR> bd #<CR>
|
|
|
|
" Move to the next tab
|
|
nmap <leader>tl :tabnext<CR>
|
|
|
|
" Move to the previous tab
|
|
nmap <leader>tj :tabprevious<CR>
|
|
|
|
" Close the current tab
|
|
nmap <leader>tq :tabclose<CR>
|
|
|
|
" Clear quickfix shortcut
|
|
nmap <Leader>c :ccl<CR>
|