General vim improvements.
More dependent on non-defaults however.
This commit is contained in:
parent
1ccd582a7b
commit
44ff7c9a95
96
.vimrc
96
.vimrc
|
@ -1,28 +1,47 @@
|
||||||
""""""""""""""""""""""
|
" \ / o _ _
|
||||||
" __ _____ __ __ "
|
" \/ | | | |
|
||||||
" \ \ / /_ _| \/ | "
|
|
||||||
" \ V / | || |\/| | "
|
|
||||||
" \_/ |___|_| |_| "
|
|
||||||
" "
|
|
||||||
""""""""""""""""""""""
|
|
||||||
set nocp
|
set nocp
|
||||||
|
set shell=/usr/bin/zsh
|
||||||
so ~/.vim/user/files.vim
|
|
||||||
|
|
||||||
colorscheme desert
|
|
||||||
syntax enable
|
|
||||||
|
|
||||||
set tsr+=~/.vim/thesaurus/thesaurus-vim-en
|
set tsr+=~/.vim/thesaurus/thesaurus-vim-en
|
||||||
set dict+=/usr/share/dict/words
|
set dict+=/usr/share/dict/words
|
||||||
|
|
||||||
set foldmethod=syntax
|
set tags=./tags;/ " Search up to / for tags file
|
||||||
set foldlevelstart=5
|
set updatetime=100
|
||||||
|
set clipboard=unnamedplus " Use system clipboard
|
||||||
|
|
||||||
|
set termguicolors
|
||||||
|
let &t_8f = "\<Esc>[38:2:%lu:%lu:%lum"
|
||||||
|
let &t_8b = "\<Esc>[48:2:%lu:%lu:%lum"
|
||||||
|
syntax enable
|
||||||
|
|
||||||
|
colorscheme jellybeans
|
||||||
|
|
||||||
|
let mapleader=" "
|
||||||
|
|
||||||
|
" Auto open NERDTree but focus editing window
|
||||||
|
autocmd VimEnter * NERDTree
|
||||||
|
autocmd BufEnter * NERDTreeMirror
|
||||||
|
autocmd VimEnter * wincmd w
|
||||||
|
autocmd VimEnter * NERDTreeFind
|
||||||
|
autocmd VimEnter * wincmd w
|
||||||
|
" Auto close NERDTree
|
||||||
|
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
|
||||||
|
|
||||||
|
set mouse=a
|
||||||
|
|
||||||
set backspace=indent,eol,start
|
set backspace=indent,eol,start
|
||||||
|
|
||||||
set splitbelow
|
set splitbelow
|
||||||
set splitright
|
set splitright
|
||||||
|
|
||||||
|
set foldmethod=syntax
|
||||||
|
set foldlevelstart=99
|
||||||
|
|
||||||
|
" Leave some room when scrolling
|
||||||
|
set scrolloff=3
|
||||||
|
|
||||||
nnoremap :W<CR> :w<CR>
|
nnoremap :W<CR> :w<CR>
|
||||||
|
|
||||||
set conceallevel=0
|
set conceallevel=0
|
||||||
|
@ -33,9 +52,6 @@ set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab
|
||||||
" Except for makefiles
|
" Except for makefiles
|
||||||
autocmd FileType make setlocal noexpandtab
|
autocmd FileType make setlocal noexpandtab
|
||||||
|
|
||||||
" Search up to / for tags file
|
|
||||||
set tags=./tags;/
|
|
||||||
|
|
||||||
" *** BINDINGS ***
|
" *** BINDINGS ***
|
||||||
|
|
||||||
" Beautful escapes
|
" Beautful escapes
|
||||||
|
@ -55,7 +71,6 @@ set number relativenumber
|
||||||
|
|
||||||
set ignorecase smartcase
|
set ignorecase smartcase
|
||||||
set autoindent smartindent
|
set autoindent smartindent
|
||||||
|
|
||||||
"Yank to clipboard
|
"Yank to clipboard
|
||||||
nnoremap <C-C> "+yy
|
nnoremap <C-C> "+yy
|
||||||
vnoremap <C-C> "+y
|
vnoremap <C-C> "+y
|
||||||
|
@ -81,7 +96,9 @@ tnoremap <C-K> <C-W><C-K>
|
||||||
tnoremap <C-L> <C-W><C-L>
|
tnoremap <C-L> <C-W><C-L>
|
||||||
tnoremap <C-H> <C-W><C-H>
|
tnoremap <C-H> <C-W><C-H>
|
||||||
|
|
||||||
nnoremap ! :!
|
" Jump to next/prev uppercase/underscore
|
||||||
|
nnoremap f<cr> /[A-Z_]<cr>
|
||||||
|
nnoremap F<cr> ?[A-Z_]<cr>
|
||||||
|
|
||||||
" Map directions to end/beginning of lines
|
" Map directions to end/beginning of lines
|
||||||
nnoremap yl y$
|
nnoremap yl y$
|
||||||
|
@ -96,14 +113,6 @@ nnoremap <C-P> m`v$hp``y$
|
||||||
nnoremap <Leader>PP :ha > ~/.vim.ps<CR>:!xdg-open ~/.vim.ps<CR>
|
nnoremap <Leader>PP :ha > ~/.vim.ps<CR>:!xdg-open ~/.vim.ps<CR>
|
||||||
vnoremap <Leader>PP :ha > ~/.vim.ps<CR>:!xdg-open ~/.vim.ps<CR>
|
vnoremap <Leader>PP :ha > ~/.vim.ps<CR>:!xdg-open ~/.vim.ps<CR>
|
||||||
|
|
||||||
" Return spelling corrections
|
|
||||||
iab ruetn return
|
|
||||||
iab reteun return
|
|
||||||
iab reutner return
|
|
||||||
|
|
||||||
nnoremap cw ciw
|
|
||||||
nnoremap ciw cw
|
|
||||||
|
|
||||||
" Swap current word with next
|
" Swap current word with next
|
||||||
nnoremap gs "xdiwdwep"xp
|
nnoremap gs "xdiwdwep"xp
|
||||||
" Inverted
|
" Inverted
|
||||||
|
@ -124,9 +133,11 @@ nnoremap <Leader>gu :!git add -u<CR>
|
||||||
nnoremap <Leader>ga :!git add %<CR>
|
nnoremap <Leader>ga :!git add %<CR>
|
||||||
|
|
||||||
nnoremap <Leader>r :source ~/.vimrc<CR>
|
nnoremap <Leader>r :source ~/.vimrc<CR>
|
||||||
nnoremap <Leader>v :tabedit~/.vimrc<CR>
|
|
||||||
nnoremap <Leader>n :tabedit~/.notes<CR>
|
nnoremap <Leader>n :tabedit~/.notes<CR>
|
||||||
|
|
||||||
|
nnoremap <Leader>v :vert term ++cols=80<CR>
|
||||||
|
nnoremap <Leader>t :term ++rows=20<CR>
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead * if expand('%:t') !~ '\.' | setl spell | endif
|
autocmd BufNewFile,BufRead * if expand('%:t') !~ '\.' | setl spell | endif
|
||||||
|
|
||||||
" Expand %% to the current files dir
|
" Expand %% to the current files dir
|
||||||
|
@ -146,3 +157,32 @@ if has ("autocmd")
|
||||||
autocmd BufNewFile makefile 0r ~/.vim/templates/makefile
|
autocmd BufNewFile makefile 0r ~/.vim/templates/makefile
|
||||||
augroup END
|
augroup END
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let s:copypastemode = 0
|
||||||
|
function! ToggleCopyPaste()
|
||||||
|
if s:copypastemode
|
||||||
|
set nopaste
|
||||||
|
set number
|
||||||
|
set relativenumber
|
||||||
|
let s:copypastemode = 0
|
||||||
|
else
|
||||||
|
set paste
|
||||||
|
set nonumber
|
||||||
|
set norelativenumber
|
||||||
|
let s:copypastemode = 1
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
nnoremap <F3> :call ToggleCopyPaste()<CR>
|
||||||
|
inoremap <F3> <Esc>:call ToggleCopyPaste()<CR>i
|
||||||
|
nnoremap <RightMouse> p
|
||||||
|
inoremap <RightMouse> <Esc>p
|
||||||
|
|
||||||
|
" Spelling corrections
|
||||||
|
iab ruetn return
|
||||||
|
iab reteun return
|
||||||
|
iab reutner return
|
||||||
|
|
||||||
|
" Keep same gutter color when errored
|
||||||
|
highlight! link SignColumn LineNr
|
||||||
|
|
||||||
|
so ~/.vim/user/files.vim
|
||||||
|
|
Loading…
Reference in New Issue