dotfiles

$HOME is where the <3 is
git clone git://git.alexkarle.com/dotfiles.git
Log | Files | Refs | Submodules | README

commit 7e9f3763aa61c5f5846f9c9a3b59706f4d6253be (patch)
parent 1b5ce5adc9a2f5c70f3a1bf16785543837cd46af
Author: Alexander Karle <akarle@umass.edu>
Date:   Thu,  3 May 2018 17:11:37 -0400

Second Vimscript function! Simple toggle setting

Diffstat:
Mvim/vimrc | 13++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/vim/vimrc b/vim/vimrc @@ -213,6 +213,14 @@ function! CMDPreserve(command) abort let @/=_s call cursor(l, c) endfunction + +function! ToggleColorColumn() abort + if &colorcolumn == "" + set colorcolumn=80 + else + set colorcolumn="" + endif +endfunction " }}} " KEY MAPPINGS {{{ @@ -237,9 +245,12 @@ nnoremap <leader><space> :call CMDPreserve("%s/\\s\\+$//e")<CR> " edit in current buffer dir nnoremap <leader>e :e %:h/ nnoremap <leader>v :vsp %:h/ -nnoremap <leader>s :vsp %:h/ +nnoremap <leader>s :sp %:h/ " quick toggle for light/dark background nnoremap <leader>L :set background=light<CR> nnoremap <leader>D :set background=dark<CR> + +" toggle color column (to ensure short lines) +nnoremap <leader>C :call ToggleColorColumn()<CR> " }}}