This commit is contained in:
Geoffrey Frogeye 2020-05-25 09:05:56 +02:00
parent 4a8628231c
commit 5e500da16b
15 changed files with 177 additions and 36 deletions

17
config/vim/paths.vim Normal file
View file

@ -0,0 +1,17 @@
" Put plugins and dictionaries in this dir (also on Windows)
let vimDir = '$HOME/.cache/vim'
let &runtimepath.=','.vimDir
" theme
source $HOME/.cache/vim/colorscheme.vim
" Keep undo history across sessions by storing it in a file
if has('persistent_undo')
let myUndoDir = expand(vimDir . '/undodir')
" Create dirs
call system('mkdir ' . vimDir)
call system('mkdir ' . myUndoDir)
let &undodir = myUndoDir
set undofile
endif

View file

@ -174,3 +174,11 @@ let g:vista#renderer#icons = {
\ "variable": "x",
\ }
" EasyAlign
" Align GitHub-flavored Markdown tables
au FileType markdown vmap <Bar> :EasyAlign*<Bar><Enter>
" SmoothScroll
noremap <silent> <C-K> :call smooth_scroll#up(20, 5, 1)<CR>
noremap <silent> <C-J> :call smooth_scroll#down(20, 5, 1)<CR>

View file

@ -18,7 +18,7 @@ call plug#begin('~/.cache/vim/plugged')
" Plug 'rstacruz/sparkup', {'rtp': 'vim/'}
Plug 'chriskempson/base16-vim'
Plug 'tpope/vim-surround'
" Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-fugitive'
" Plug 'tpope/vim-repeat'
" Regex for words, with case in mind
@ -94,5 +94,11 @@ Plug 'liuchengxu/vista.vim'
" Semantic highlighting for Python
Plug 'numirias/semshi', {'do': ':UpdateRemotePlugins'}
" Aligning lines around a certain character
Plug 'junegunn/vim-easy-align'
" Various for Ansible
Plug 'pearofducks/ansible-vim', { 'do': './UltiSnips/generate.sh' }
call plug#end()

View file

@ -64,22 +64,8 @@ set wildmode=longest,list
set wildmenu
set showcmd
" Put plugins and dictionaries in this dir (also on Windows)
let vimDir = '$HOME/.cache/vim'
let &runtimepath.=','.vimDir
" theme
source $HOME/.cache/vim/colorscheme.vim
" Keep undo history across sessions by storing it in a file
if has('persistent_undo')
let myUndoDir = expand(vimDir . '/undodir')
" Create dirs
call system('mkdir ' . vimDir)
call system('mkdir ' . myUndoDir)
let &undodir = myUndoDir
set undofile
endif
" Close the file explorer once you select a file
let g:netrw_fastbrowse = 0
" Allow saving of files as sudo when I forgot to start vim using sudo.
" From https://stackoverflow.com/a/7078429
@ -91,15 +77,8 @@ vmap <Enter> <Esc>
nmap <Enter> o<Esc>
nmap <C-H> :bp<CR>
nmap <C-L> :bn<CR>
if has('nvim')
" nmap <C-K> 20k
" nmap <C-J> 20j
noremap <silent> <C-K> :call smooth_scroll#up(20, 5, 1)<CR>
noremap <silent> <C-J> :call smooth_scroll#down(20, 5, 1)<CR>
else
nmap <C-K> kkkkkkkkkkkkkkkkkkkkk
nmap <C-J> jjjjjjjjjjjjjjjjjjjjj
endif
nmap <C-K> kkkkkkkkkkkkkkkkkkkkk
nmap <C-J> jjjjjjjjjjjjjjjjjjjjj
" \s to replace globally the word under the cursor
nnoremap <Leader>s :%s/\<<C-r><C-w>\>/

View file

@ -8,6 +8,7 @@ set runtimepath+=~/.config/vim,~/.cache/vim
set viminfo+=n~/.cache/vim/viminfo
source ~/.config/vim/pluginlist.vim
source ~/.config/vim/pluginconfig.vim
source ~/.config/vim/paths.vim
source ~/.config/vim/vimconfig.vim
source ~/.config/vim/pluginconfig.vim