|
@@ -1,4 +1,3 @@
|
|
|
-
|
|
|
" start plugins
|
|
|
execute pathogen#infect()
|
|
|
|
|
@@ -37,6 +36,9 @@ filetype indent on
|
|
|
" visual autocomplete for command menu
|
|
|
set wildmenu
|
|
|
|
|
|
+" don't autocomplete on first tab press
|
|
|
+set wildmode=list,full
|
|
|
+
|
|
|
" redraw only when necessary (faster macros)
|
|
|
set lazyredraw
|
|
|
|
|
@@ -52,9 +54,6 @@ set foldmethod=indent
|
|
|
" foldlevel when window is loaded
|
|
|
set foldlevelstart=1
|
|
|
|
|
|
-" space is Leader
|
|
|
-map <space> <leader>
|
|
|
-
|
|
|
" fold based on indent level
|
|
|
set foldmethod=indent
|
|
|
|
|
@@ -83,58 +82,14 @@ if !(has("win32") || has("win16") || has("win32unix"))
|
|
|
endif
|
|
|
endif
|
|
|
|
|
|
-"caps switching functions - unused
|
|
|
-"" function to check for running instances of vim on Linux
|
|
|
-"function! UnixCapsControl()
|
|
|
-" silent! let running = system('echo $(pgrep -c vim)')
|
|
|
-" if(running <= 1)
|
|
|
-" silent! !xmodmap -e 'clear Lock' -e 'keycode 0x42 = Caps_Lock'
|
|
|
-" endif
|
|
|
-"endfunction
|
|
|
-"
|
|
|
-"" map caps lock to escape under Linux
|
|
|
-"!(has("win32") || has("win16") || has("win32unix")) && (!$SSH_CLIENT && !$SSH_TTY) && executable("xmodmap")
|
|
|
-"
|
|
|
-" au VimEnter * silent! !xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'
|
|
|
-" au VimLeave * :call UnixCapsControl()
|
|
|
-"endif
|
|
|
-"
|
|
|
-"" function to check for running instances of vim on Windows
|
|
|
-"function! WindowsCapsControl()
|
|
|
-" silent! let running = system('tasklist /FI "IMAGENAME eq vim.exe" 2>NUL | find /I /C "vim.exe"')
|
|
|
-" if(running <= 1)
|
|
|
-" silent! !start taskkill /IM CapsEsc.exe
|
|
|
-" endif
|
|
|
-"endfunction
|
|
|
-"
|
|
|
-"" map caps lock to escape under Windows
|
|
|
-"if (has("win32") || has("win16"))
|
|
|
-" au VimEnter * silent! !start C:\Users\Josh\vimfiles\CapsEsc.exe
|
|
|
-" au VimLeave * :call WindowsCapsControl()
|
|
|
-"endif
|
|
|
-""
|
|
|
-"" function to check for running instances of vim on Cygwin
|
|
|
-"function! CygwinCapsControl()
|
|
|
-" silent! let running = system('echo $(pgrep -c vim)')
|
|
|
-" if(running <= 1)
|
|
|
-" silent! !pkill CapsEsc
|
|
|
-" endif
|
|
|
-"endfunction
|
|
|
-"
|
|
|
-"" map caps lock to escape under Cygwin
|
|
|
-"if (has("win32unix"))
|
|
|
-" au VimEnter * silent! !/home/josh/.vim/CapsEsc.exe &
|
|
|
-" au VimLeave * :call CygwinCapsControl()
|
|
|
-"endif
|
|
|
-
|
|
|
" swap files are rotated every 10 keystrokes
|
|
|
set updatecount=10
|
|
|
|
|
|
" backspace is used to remove previous characters, indents, and newlines
|
|
|
set backspace=indent,eol,start
|
|
|
|
|
|
-" <Leader>l formats a line
|
|
|
-noremap <Leader>l Vgq
|
|
|
+" Map Ctrl-Backspace to delete the previous word in insert mode.
|
|
|
+imap <C-BS> <C-W>
|
|
|
|
|
|
" make an undo file to allow undoing after closing a file
|
|
|
set undofile
|
|
@@ -143,6 +98,23 @@ set undodir=~/.vim/undodir
|
|
|
" set Makefiles with tabs not spaces
|
|
|
autocmd FileType make setlocal noexpandtab
|
|
|
|
|
|
+" write w/ privileges when Vim isn't started as root
|
|
|
+cmap w!! %!sudo tee > /dev/null %
|
|
|
+
|
|
|
+" toggle background
|
|
|
+function! ClearBG()
|
|
|
+ highlight Normal ctermbg=none
|
|
|
+endfunction
|
|
|
+
|
|
|
+function! BlackBG()
|
|
|
+ highlight Normal ctermbg=black
|
|
|
+endfunction
|
|
|
+
|
|
|
+" leader
|
|
|
+
|
|
|
+" space is Leader
|
|
|
+map <space> <leader>
|
|
|
+
|
|
|
" compare current buffer to saved file
|
|
|
function! s:DiffWithSaved()
|
|
|
let filetype=&ft
|
|
@@ -156,23 +128,16 @@ com! DiffSaved call s:DiffWithSaved()
|
|
|
" map the comp buff function above
|
|
|
noremap <Leader>d :DiffSaved<CR>
|
|
|
|
|
|
-" map the write and make function
|
|
|
-noremap <Leader>c :WriteMake<CR>
|
|
|
-
|
|
|
-" write w/ privileges when Vim isn't started as root
|
|
|
-cmap w!! %!sudo tee > /dev/null %
|
|
|
+" <Leader>l formats a line
|
|
|
+noremap <Leader>l Vgq
|
|
|
|
|
|
" remove trailing whitespace and return to start position
|
|
|
-noremap <Leader>w :%s/\s\+$//<CR>``
|
|
|
-
|
|
|
-" toggle background
|
|
|
-function! ClearBG()
|
|
|
- highlight Normal ctermbg=none
|
|
|
-endfunction
|
|
|
-
|
|
|
-function! BlackBG()
|
|
|
- highlight Nornal ctermbg=black
|
|
|
-endfunction
|
|
|
+" remove lighlight if in nvim
|
|
|
+if has('nvim')
|
|
|
+ noremap <Leader>w :%s/\s\+$//<CR>:nohl<CR>``
|
|
|
+else
|
|
|
+ noremap <Leader>w :%s/\s\+$//<CR>``
|
|
|
+endif
|
|
|
|
|
|
" plugins
|
|
|
|