From 1c7e0f2480f111ccff4e12af238d26e41839524b Mon Sep 17 00:00:00 2001 From: hellerve Date: Tue, 12 Mar 2019 13:36:38 +0100 Subject: [PATCH] vim: remove crud --- vimrc | 182 ++++++++++++++++------------------------------------------ 1 file changed, 50 insertions(+), 132 deletions(-) diff --git a/vimrc b/vimrc index 3546958..264b131 100644 --- a/vimrc +++ b/vimrc @@ -1,12 +1,5 @@ " General {{{ -" use indentation for folds -set foldmethod=indent -set foldnestmax=5 -set foldlevelstart=99 -set foldcolumn=0 - - " Sets how many lines of history VIM has to remember set history=700 @@ -27,12 +20,6 @@ noremap ,, , " Use par for prettier line formatting set formatprg="PARINIT='rTbgqR B=.,?_A_a Q=_s>|' par\ -w72" -" Use stylish haskell instead of par for haskell buffers -augroup haskell_file - autocmd! - autocmd FileType haskell let &formatprg="stylish-haskell" -augroup END - " Kill the damned Ex mode. nnoremap Q @@ -52,16 +39,6 @@ Bundle 'gmarik/vundle' " Support bundles Bundle 'scrooloose/syntastic' -" Git -Bundle 'tpope/vim-fugitive' - -" Bars, panels, and files -"Bundle 'scrooloose/nerdtree' -Bundle 'bling/vim-airline' - -" Haskell -Bundle 'raichoo/haskell-vim' - " Other programming languages Bundle 'zepto-lang/zepto-vim' Bundle 'hellerve/carp-vim' @@ -73,18 +50,10 @@ Plugin 'JuliaEditorSupport/julia-vim' " Extra Plugin 'editorconfig/editorconfig-vim' -" Custom bundles -if filereadable(expand("~/.vim.local/bundles.vim")) - source ~/.vim.local/bundles.vim -endif - " }}} " VIM user interface {{{ -" Set 7 lines to the cursor - when moving vertically using j/k -set so=7 - " Turn on the WiLd menu set wildmenu " Tab-complete files up to longest unambiguous prefix @@ -144,12 +113,6 @@ endif " Force redraw map r :redraw! -" Turn mouse mode on -nnoremap ma :set mouse=a - -" Turn mouse mode off -nnoremap mo :set mouse= - " Default to mouse mode on set mouse=a " }}} @@ -202,9 +165,6 @@ augroup END " Open file prompt with current path nmap e :e =expand("%:p:h") . '/' -" Show undo tree -nmap u :GundoToggle - " Fuzzy find files nnoremap :CtrlP let g:ctrlp_max_files=0 @@ -233,10 +193,6 @@ set ai "Auto indent set si "Smart indent set wrap "Wrap lines -" Pretty unicode haskell symbols -let g:haskell_conceal_wide = 1 -let g:haskell_conceal_enumerations = 1 - " }}} " Visual mode related {{{ @@ -277,7 +233,57 @@ set hidden " Status line {{{ +let g:mode_map={ + \ '__' : '------', + \ 'c' : 'COMMAND', + \ 'i' : 'INSERT', + \ 'ic' : 'INSERT COMPL', + \ 'ix' : 'INSERT COMPL', + \ 'n' : 'NORMAL', + \ 'ni' : '(INSERT)', + \ 'no' : 'OP PENDING', + \ 'R' : 'REPLACE', + \ 'Rv' : 'V REPLACE', + \ 's' : 'SELECT', + \ 'S' : 'S-LINE', + \ '' : 'S-BLOCK', + \ 't' : 'TERMINAL', + \ 'v' : 'VISUAL', + \ 'V' : 'V-LINE', + \ '' : 'V-BLOCK', +\ } + +let g:mode_color_map={ + \ '__' : 'magenta', + \ 'c' : 'red', + \ 'i' : '208', + \ 'ic' : '208', + \ 'ix' : '208', + \ 'n' : 'white', + \ 'ni' : '208', + \ 'no' : 'red', + \ 'R' : '135', + \ 'Rv' : '135', + \ 's' : '135', + \ 'S' : '135', + \ '' : '135', + \ 't' : 'white', + \ 'v' : '135', + \ 'V' : '135', + \ '' : '135', +\ } + +function! GetMode() + let col=get(g:mode_color_map, mode(), mode()) + exec printf("hi StatusLine ctermbg=%s", col) + return get(g:mode_map, mode(), mode()) +endfunction + +set statusline=%{GetMode()}\ \ \ \ %.20f\ %m\ %r%=%c\ %l\/%L\ \(%2p%%\)\ %y +"set statusline=%y + " Always show the status line + set laststatus=2 " }}} @@ -298,13 +304,6 @@ augroup END " }}} -" Spell checking {{{ - -" Pressing ,ss will toggle and untoggle spell checking -map ss :setlocal spell! - -" }}} - " Helper functions {{{ function! CmdLine(str) @@ -336,93 +335,12 @@ endfunction " }}} -" NERDTree {{{ - -" Close nerdtree after a file is selected -let NERDTreeQuitOnOpen = 1 - -function! IsNERDTreeOpen() - return exists("t:NERDTreeBufName") && (bufwinnr(t:NERDTreeBufName) != -1) -endfunction - -function! ToggleFindNerd() - if IsNERDTreeOpen() - exec ':NERDTreeToggle' - else - exec ':NERDTreeFind' - endif -endfunction - -" If nerd tree is closed, find current file, if open, close it -nmap f :call ToggleFindNerd() -nmap F :NERDTreeToggle - -" }}} - -" Alignment {{{ - -" Stop Align plugin from forcing its mappings on us -let g:loaded_AlignMapsPlugin=1 -" Align on equal signs -map a= :Align = -" Align on commas -map a, :Align , -" Align on pipes -map a :Align -" Prompt for align character -map ap :Align - -" Enable some tabular presets for Haskell -let g:haskell_tabular = 1 - -" }}} - " Tags {{{ set tags=tags;/,codex.tags;/ " }}} -" Git {{{ - -let g:extradite_width = 60 -" Hide messy Ggrep output and copen automatically -function! NonintrusiveGitGrep(term) - execute "copen" - " Map 't' to open selected item in new tab - execute "nnoremap t T" - execute "silent! Ggrep " . a:term - execute "redraw!" -endfunction - -function! CommittedFiles() - " Clear quickfix list - let qf_list = [] - " Find files committed in HEAD - let git_output = system("git diff-tree --no-commit-id --name-only -r HEAD\n") - for committed_file in split(git_output, "\n") - let qf_item = {'filename': committed_file} - call add(qf_list, qf_item) - endfor - " Fill quickfix list with them - call setqflist(qf_list, '') -endfunction - -" }}} - -" Haskell Interrogation {{{ - -set completeopt+=longest - -" Use buffer words as default tab completion -let g:SuperTabDefaultCompletionType = '' - -" Haskell Lint -let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['haskell'] } -nmap hl :SyntasticCheck hlint - -" }}} - " Conversion {{{ function! Pointfree()