commit d7c745f447eb6e6f76852536f38719efe25f3426
parent ce40810693f818b83d404a4a8e1fae3315db1880
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Thu, 18 Oct 2018 11:06:02 +0200
Remove general calls from vimrc, only add certain bindings if the plugins are loaded
Diffstat:
3 files changed, 20 insertions(+), 50 deletions(-)
diff --git a/links/.vim/plugin/appearance.vim b/links/.vim/plugin/appearance.vim
@@ -84,11 +84,15 @@ augroup StatuslineConfig
" right
set statusline+=%4* " set background color
- set statusline+=%7*%{StatuslineLinterWarnings()}%4* " ALE warnings
- set statusline+=%6*%{StatuslineLinterErrors()}%4* " ALE errors
- set statusline+=%{StatuslineLinterOK()} " ALE ok
+ if exists('g:ale_enabled')
+ set statusline+=%7*%{StatuslineLinterWarnings()}%4* " ALE warnings
+ set statusline+=%6*%{StatuslineLinterErrors()}%4* " ALE errors
+ set statusline+=%{StatuslineLinterOK()} " ALE ok
+ end
set statusline+=%2* " set User2 color
- set statusline+=\ %{LineNoIndicator()}\ " show file position with single char
+ if exists('g:line_no_indicator_chars')
+ set statusline+=\ %{LineNoIndicator()}\ " show position w. single char
+ end
set statusline+=%3* " set User3 color
set statusline+=\ %2l:%-2c\ " line and column view
diff --git a/links/.vim/plugin/keybinds.vim b/links/.vim/plugin/keybinds.vim
@@ -92,11 +92,13 @@ end
"nnoremap <leader><CR> :terminal bash<CR>
nnoremap <leader><CR> :terminal<CR>
-let g:tmux_navigator_no_mappings = 1
-nnoremap <silent> <C-h> :TmuxNavigateLeft<CR>
-nnoremap <silent> <C-j> :TmuxNavigateDown<CR>
-nnoremap <silent> <C-k> :TmuxNavigateUp<CR>
-nnoremap <silent> <C-l> :TmuxNavigateRight<CR>
+if exists(':TmuxNavigateLeft')
+ let g:tmux_navigator_no_mappings = 1
+ nnoremap <silent> <C-h> :TmuxNavigateLeft<CR>
+ nnoremap <silent> <C-j> :TmuxNavigateDown<CR>
+ nnoremap <silent> <C-k> :TmuxNavigateUp<CR>
+ nnoremap <silent> <C-l> :TmuxNavigateRight<CR>
+end
" equal split size
nnoremap <leader>= <C-w>=
@@ -149,7 +151,11 @@ elseif executable("ag")
end
" using fzf.vim
-nnoremap , :Buffers<CR>
+if exists(':Buffers')
+ nnoremap , :Buffers<CR>
+else
+ nnoremap , :ls<CR>:buffer<Space>
+end
nnoremap <leader>o :History<CR>
nnoremap <leader>f :Files<CR>
nnoremap <leader>F :GFiles<CR>
diff --git a/links/.vim/vimrc b/links/.vim/vimrc
@@ -4,43 +4,3 @@ if has('python3')
endif
source ~/.vim/plugins.vim " make sure that plugins are sourced first
-
-set autoread " reload files when changed on disk
-set backspace=2 " fix broken backspace in some setups
-set backupcopy=yes " see :help crontab
-set clipboard=unnamed " use system clipboard
-set dictionary+=/usr/share/dict/words " word completion using Ctrl-x Ctrl-k
-set expandtab " use the appropriate number of spaces for <Tab>
-set hlsearch " highlight search matches
-set ignorecase " case-insensitive search
-set incsearch " search as you type
-set laststatus=2 " always show the statusline
-set lbr " break lines between words
-set list " enable rendering of invisible characters
-set listchars=tab:▸\ ,eol:¬ " Use symbols for tab and end-of-line
-set nojoinspaces " disable double spaces after periods
-set pastetoggle=<F2> " toggle paste mode
-set scrolloff=3 " show context above-below cursorline
-set shiftwidth=4 " width for autoindents
-set smartcase " case-sensitive search if any caps
-set splitright " new vertical splits on the right side
-set tabstop=4 " number of spaces for tab
-set textwidth=80 " default line width in number of characters
-set wildmenu " show a navigable menu for tab completion
-set wildmode=longest,list,full
-
-" specify mutt aliases path, autocomplete aliases with @@ in insert mode
-let g:mutt_aliases_file = '~/.mutt/aliases'
-
-" split size for :Lex[plore] and :Hex[plore]. Percentage when positive, line/col
-" number when negative
-let g:netrw_winsize = 20
-
-" use faster :grep alternatives when available
-if executable("rg")
- set grepprg=rg\ --vimgrep\ --no-heading
- set grepformat=%f:%l:%c:%m,%f:%l:%m
-elseif executable("ag")
- set grepprg=ag\ --nogroup\ --nocolor\ --ignore-case\ --column
- set grepformat=%f:%l:%c:%m,%f:%l:%m
-endif