From 78dfb81d829fd06ce01a9394a0c8519cb4c92c67 Mon Sep 17 00:00:00 2001 From: Alexander Karle Date: Mon, 12 Mar 2018 18:29:56 -0400 Subject: [PATCH] Tweaking Vimrc Fixing escape delay, adding wildmenu and cursor line on insert, key mapping for making a new session (overwrite old), and (shocking!) drifting from jk as (in favor of CTRL-[) --- vim/ftplugin/tex.vim | 4 ++++ vim/keys.vim | 5 ++++- vim/theme.vim | 19 +++++++++++++------ vim/vimrc | 14 +++++++++++++- 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/vim/ftplugin/tex.vim b/vim/ftplugin/tex.vim index b07436a..d12f7e4 100644 --- a/vim/ftplugin/tex.vim +++ b/vim/ftplugin/tex.vim @@ -6,3 +6,7 @@ noremap $ g$ " spell check! setlocal spell spelllang=en_us + +" soft word wrap should not break words +" NOTE: don't use listchars with this feature +set linebreak diff --git a/vim/keys.vim b/vim/keys.vim index cea7584..ba3f3fc 100644 --- a/vim/keys.vim +++ b/vim/keys.vim @@ -2,7 +2,7 @@ " KEY MAPPINGS "================================ "Map 'jk' to ESC (its wonderful) -inoremap jk +" inoremap jk "TEMPORARILY COMMENTING IN FAVOR OF ctrl-[ "Map ctrl-i/j/k/h to switch between splits nnoremap j @@ -18,3 +18,6 @@ iabbrev " Elim Whitespace (through regexp) nmap _$ :call CMDPreserve("%s/\\s\\+$//e") + +" save session +nnoremap s :mksession! diff --git a/vim/theme.vim b/vim/theme.vim index 907402c..d799b82 100644 --- a/vim/theme.vim +++ b/vim/theme.vim @@ -4,23 +4,30 @@ "Syntax highlighting on syntax on +" Set cursor line when in insert mode (to indicate insert mode) +if(has('autocmd')) + autocmd InsertEnter,InsertLeave * set cul! +endif + " COLORSCHEME -" use iterm profiles to determin background +" use iterm profiles to determine background if $ITERM_PROFILE=='light_background' set background=light else set background=dark endif -" load colorscheme if plugins installed -if filereadable(expand("~/.vim/bundle/vim-one/colors/one.vim")) - colorscheme one -endif - " if can use truecolor, do if (has("termguicolors")) set termguicolors + " load colorscheme if plugins installed + if filereadable(expand("~/.vim/bundle/vim-one/colors/one.vim")) + colorscheme one + " reverse one-dark's fold colors + highlight Folded guibg=#282c34 guifg=#5c6370 + endif + " Needed for termgui in tmux--&term begins w screen-... if &term =~# '^screen' " Set the terminal foreground+background colors diff --git a/vim/vimrc b/vim/vimrc index 62c1c79..a9c7ebb 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -3,7 +3,7 @@ "============================= "line numbers on set number -set relativenumber +"set relativenumber "tab is really spaces set expandtab "4 spaces per tab @@ -41,6 +41,18 @@ set listchars=space:·,tab:>–,trail:~,eol:¬ " Prevent {}, (), [] commands from opening folds set foldopen-=block +" Prevent windows resizing when split opened/closed +set noequalalways + +" Show the command being typed +set showcmd + +" More visual completion for command mode +set wildmenu + +" Set key code timeout to be less to avoid delay +set ttimeoutlen=30 + " Source helper files " Only load plugins if vim-plug installed! if filereadable(expand("~/.vim/autoload/plug.vim")) -- libgit2 0.28.4