From b52f09995bd0eba93f6f29d3d41f598d47754139 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 3 Oct 2016 08:05:08 +0200 Subject: Clean vim configuration little bit more --- shellrc | 5 +---- vimrc | 66 ++++++++++++++++++++++++----------------------------------------- 2 files changed, 25 insertions(+), 46 deletions(-) diff --git a/shellrc b/shellrc index b1a4796..0f84d26 100644 --- a/shellrc +++ b/shellrc @@ -29,10 +29,7 @@ export LESS_TERMCAP_ue=$'\E[0m' export LESS_TERMCAP_us=$'\E[1;32m' alias gst='git status' -alias vimc='vim -c "call InitC()"' -alias vimb='vim -c "call InitBase()"' -alias vimp='vim -c "call InitPython()"' -alias vims='vim -c "call InitBash()"' +alias v='vim' alias i='i3-msg' # Systemd aliases diff --git a/vimrc b/vimrc index c16bd09..4460f33 100644 --- a/vimrc +++ b/vimrc @@ -18,6 +18,11 @@ set foldmethod=syntax set wildmode=longest:full,full set wildmenu +set number +set colorcolumn=82 +set textwidth=82 +highlight ColorColumn ctermbg=darkgray + colorscheme elflord " Tabs setting. In default we want 4 spaces tab, but allows also 8 spaced tabs @@ -73,53 +78,30 @@ set ttymouse=urxvt " We are always on fast tty (maybe remove this on servers?) set ttyfast -" Some fast shortcuts -map :call InitBase() +" Open tagbar with nmap :TagbarOpen fc -map :setlocal spell! spelllang=en_us -map :setlocal spell! spelllang=cs - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -function InitBase() - set number - set colorcolumn=82 - set textwidth=82 - highlight ColorColumn ctermbg=darkgray -endfunction - -function InitBash() - call InitBase() - " Format current file with indent - map gg=G2 - - map :w - map :wa -endfunction - -function InitPython() - call InitBase() - set colorcolumn=79 - set textwidth=79 - - unmap - map :w - map :wa +" Spell checking +map :setlocal spell! +function LangToggle() + if &spelllang != "en_us" + setlocal spelllang=en_us + echo "spelllang=en_us" + else + setlocal spelllang=cs + echo "spelllang=cs" + endif endfunction +setlocal spelllang=en_us +map :call LangToggle() -function InitC() - call InitBase() - - " TODO bind F2 to execute gnu ident on whole file and ensure that if it fails, no change is done. - map :w - map :wa - map :w:make - map :cp - map :cn - map :cl +" TODO for python file type set: +" set colorcolumn=79 +" set textwidth=79 - " TODO check if .tags exists and alternativelly generate -endfunction +" TODO for C file type set: +" TODO bind F2 to execute gnu ident on whole file and ensure that if it fails, no change is done. +" TODO check if .tags exists and alternativelly warn that it missing let g:ycm_path_to_python_interpreter="/usr/bin/python3" let g:ycm_global_ycm_extra_conf = "~/.ycm_c_conf.py" -- cgit v1.2.3