vimrc overhaul

This commit is contained in:
Wryn Wagner 2020-10-09 16:55:04 -06:00
parent 04a5d1e557
commit ef03188909
9 changed files with 96 additions and 96 deletions

View File

@ -1,4 +1,3 @@
" -- Abbreviation Dictionary ------------------------- {{{
iabbrev @@ wagner.wryn@gmail.com
iabbrev ssig <CR>-----------------------<CR>Wryn Wagner<CR>wagner.wryn@gmail.com<CR>(720)557-5443<CR>-----------------------
@ -8,11 +7,10 @@ iabbrev apap # arrange # act # assert
iabbrev acac % arrange % act % assert
" -- JAVA -------------------------------------------- {{{
" -- java -------------------------------------------- {{{
iabbrev psvm public static void main(String[] args) {<CR>}
" }}}
" -- MARKDOWN ---------------------------------------- {{{
" -- markdown ---------------------------------------- {{{
iabbrev termdef ## Terms and Definitions<CR>Term \| Definition<CR>--- \| ---<CR>
" }}}
" }}}

View File

@ -1,6 +0,0 @@
" -- VIMRC ------------------------------------------- {{{
nnoremap <Leader>ev :vsp $WRYNVIMRC<CR>
nnoremap <Leader>sv :source $MYVIMRC<CR>
nnoremap <Leader>eb :vsp $MYBASHRC<CR>
nnoremap <Leader>emb :vsp $WRYNBASH<CR>
" }}}

View File

@ -31,7 +31,7 @@ augroup execute_file_shortcuts
augroup end
" }}}
" -- Miscelaneous File-specific Commands ----------------- {{{
" -- Miscellaneous File-specific Commands ---------------- {{{
augroup latex_commands
" overwrite the <leader>t 'test' to (double) recompile the latex document.

View File

@ -1,23 +1,21 @@
set linebreak " automatically wraps text
set breakindent " indent for single-line wrap
set breakindentopt=shift:3 " indent amount for single-line wrap
set formatoptions=lj
" l = prevents the breaking up of words
" j = remove comment leaders when joining lines
let &t_co=256 " use 256-color
set number relativenumber
set number " show line numbers
set relativenumber
set linebreak breakindent breakindentopt=shift:3
set autoindent smartindent
set autoindent " match indentation with next line
set smartindent " match indentation with syntax
set spellfile=$VIM_DIR/en.utf-8.add
set spelllang=en
set timeoutlen=200
set showmatch " -- emit 'beep' when no matching symbol,
set matchtime=0 " -- but don't jump to it.
set timeoutlen=200 " -- short timeout for multi-key functions
set t_ZH= t_ZR= " italic start / end characters
set spellfile=$VIM_DIR/en.utf-8.add spelllang=en
set encoding=utf-8
let &t_co=256

22
vim/navigation.vim Normal file
View File

@ -0,0 +1,22 @@
" (SHIFT + DIRECTION) for tabs
nnoremap <S-l> gt
nnoremap <S-h> gT
nnoremap <S-t> <C-w>T
" (CTRL + DIRECTION) for panes
nnoremap <C-l> <C-w>l
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
" (CTRL + n/p) for files
nnoremap <C-n> :n<CR>
nnoremap <C-p> :N<CR>
" (<LEADER> + e + RC_PREFIX) for edit rc
nnoremap <Leader>ev :sp $WRYNVIMRC<CR>
nnoremap <Leader>sv :source $MYVIMRC<CR>
nnoremap <Leader>eb :sp $BASHRC<CR>
nnoremap <Leader>ez :sp $ZSHRC<CR>

View File

@ -1,31 +1,23 @@
" -- Environment Variables --------------------------------------- {{{
" set the following environment variables:
" $RC_DIR $VIM_DIR $WRYNVIMRC $BASHRC $ZSHRC $WEBBROWSER
source $HOME/.wryn/env/env.vim
"sets the following variables:
"$RC_DIR $VIM_DIR $WRYNVIMRC $WRYNBASH $MYBASHRC $WEBBROWSER
set encoding=utf-8
" set italics characters
set t_ZH=
set t_ZR=
let mapleader = "\\"
"let localmapleader = ','
" Load Vundle first
if isdirectory(expand("$HOME/.vim/bundle/Vundle.vim"))
source $VIM_DIR/vundle.vim
endif
source $VIM_DIR/global_sets.vim
source $VIM_DIR/file_formatting.vim
source $VIM_DIR/edit_rc.vim
source $VIM_DIR/formatting.vim
source $VIM_DIR/abbreviations.vim
source $VIM_DIR/window_pane_navigation.vim
source $VIM_DIR/my_colors.vim
source $VIM_DIR/navigation.vim
source $VIM_DIR/color.vim
augroup general_bindings
let mapleader = "\\"
"let localmapleader = ','
augroup personal_bindings
" {{{
" <SPACE> to execute macro on q
nnoremap <Space> @q
@ -33,42 +25,49 @@ augroup general_bindings
vnoremap Q !$SHELL<CR>
nnoremap Q !!$SHELL<CR>
" \q for `q:`
nnoremap <Leader>q q:
" \s previous selection command
nnoremap <Leader>s :'<,'>
" \f for fold
nnoremap <Leader>f z
nnoremap <Leader>f z
" \j for J, but append current line to the line below
nnoremap <Leader>j ddpkJ
" move the current line one below where it is
nnoremap - :m +1 <CR>
nnoremap _ :m -2 <CR>
" \t for rerun last 'test' command:
nnoremap <Leader>t q:?test<CR><CR>
" \b for git blame
nnoremap <Leader>b :set termwinsize=15*0<BAR>:execute "terminal git blame -L " .eval(line(".")-5) . ",+10 %"<BAR>:set termwinsize&<CR>
" \d to insert formatted date before/after cursor
nnoremap <Leader>di :let @d = system("date '+%A, %B %-d, %Y'")<CR>i<C-r>d<BS> <esc>
nnoremap <Leader>da :let @d = system("date '+%A, %B %-d, %Y'")<CR>a <C-r>d<BS><esc>
" - toggle casing for current word
inoremap <C-u> <esc>viw~ea
" \c \v to copy/paste from xclip
" @TODO: learn how to freaking compile vim with x11 compatibility so these
" aren't necessary :)
vnoremap <Leader>c :w !xclip<CR><CR>
nnoremap <Leader>v o<esc>!!xclip -o<CR>
" \b for git blame
nnoremap <Leader>b :set termwinsize=15*0<BAR>:execute "terminal git blame -L " .eval(line(".")-5) . ",+10 %"<BAR>:set termwinsize&<CR>
" \s previous selection command
nnoremap <Leader>sq :'<,'>
nnoremap <Leader>sc :'<,'>w !xclip<CR><CR>
" \q for `q:`
nnoremap <Leader>q q:
" \t for rerun last 'test' command:
nnoremap <Leader>t q:?test<CR><CR>
" \f for fold
nnoremap <Leader>f z
nnoremap <Leader>f z
" append current line to the line below
nnoremap <Leader>j ddpkJ
" - to move the current line one below where it is
nnoremap - :m +1 <CR>
nnoremap _ :m -2 <CR>
" - (insert mode) set current word to upper-case
inoremap <c-u> <esc>viwUea
" ------- available / rarely used bindings -------
" nnoremap <BS>
" nnoremap <C-t>
" nnoremap <C-b>
" nnoremap z
" nnoremap ^
" }}}
augroup end

View File

@ -8,28 +8,31 @@ set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" <======================================================>
" <==== Insert plugins here =============================>
" tpope/surround
Plugin 'tpope/vim-surround'
" nerdtree
Plugin 'git://github.com/scrooloose/nerdtree.git'
" youCompleteMe
Plugin 'git://github.com/Valloric/YouCompleteMe.git'
" omnisharp (c#)
Plugin 'OmniSharp/omnisharp-vim'
" ale -- asynchronus error checking
Plugin 'https://github.com/w0rp/ale'
" <======================================================>
" <======================================================>
call vundle#end()
filetype plugin indent on
" To ignore plugin indent changes, instead use:
" filetype plugin on
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
@ -37,15 +40,17 @@ filetype plugin indent on
" see :h vundle for more details or wiki for FAQ
" ===================================================================================
" === PLUGIN-SPECIFIC SETTINGS ======================================================
" ===================================================================================
" --- Nerd Tree ---
" --- Nerd Tree ---------------------------------------------------------------------
map <C-o> :NERDTreeToggle %<CR>
let g:NERDTreeNodeDelimiter = "\u00a0" " -- Was seeing ^G character, and this should fix that
" --- YouCompleteMe (YCM) ---
" --- YouCompleteMe -----------------------------------------------------------------
function! ToggleYCM()
if g:ycm_auto_trigger
let g:ycm_auto_trigger = 0
@ -58,12 +63,14 @@ endfunction
let g:ycm_goto_buffer_command = 'new-tab'
nnoremap <C-p> :call ToggleYCM()<CR>
nnoremap <S-y> :call ToggleYCM()<CR>
nnoremap gd :YcmCompleter GoToDefinition<CR>
" STARTS DEACTIVATED
" let g:ycm_auto_trigger=0
" --- ALE ---
" --- ALE ---------------------------------------------------------------------------
let g:ale_linters = {
\ 'cs' : ['OmniSharp'],
\ 'python' : ['pylint']
@ -73,6 +80,3 @@ let g:ale_lint_on_insert_leave = 'never'
nnoremap <Leader>ae :ALENext<cr>
nnoremap <Leader>ar :ALEPrevious<cr>
" --- command t ---
nnoremap T :CommandT<cr>

View File

@ -1,15 +0,0 @@
" -- Pane/Window Navigation -------------------------- {{{
" (SHIFT + DIRECTION) for tabs
nnoremap <S-l> gt
nnoremap <S-h> gT
" (CTRL + DIRECTION) for panes
nnoremap <C-l> <C-w>l
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
" (CTRL + n) for files
nnoremap <C-n> :n<CR>
nnoremap <C-b> :N<CR>
" }}}