nix: Editor config
Should have started there I guess.
This commit is contained in:
parent
3d9dc4a4bf
commit
7f71eec03c
5 changed files with 76 additions and 128 deletions
|
|
@ -1,11 +0,0 @@
|
|||
- name: Upgrade Neovim plugins
|
||||
command: "nvim +PlugUpgrade +PlugUpdate +PlugInstall +qall!"
|
||||
listen: nvim plugins changed
|
||||
environment:
|
||||
VIMINIT: "source {{ ansible_user_dir }}/.config/nvim/plugininstall.vim"
|
||||
|
||||
- name: Upgrade Vim plugins
|
||||
command: "vim +PlugUpgrade +PlugUpdate +PlugInstall +qall!"
|
||||
listen: vim plugins changed
|
||||
environment:
|
||||
VIMINIT: "source {{ ansible_user_dir }}/.config/vim/plugininstall.vim"
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
" From https://www.hillelwayne.com/post/intermediate-vim/
|
||||
|
||||
set encoding=utf-8
|
||||
set title
|
||||
|
||||
set number
|
||||
set ruler
|
||||
set wrap
|
||||
|
||||
set scrolloff=10
|
||||
|
||||
set ignorecase
|
||||
set smartcase
|
||||
set gdefault
|
||||
if has('nvim')
|
||||
set inccommand=nosplit " Shows you in realtime what changes your ex command should make.
|
||||
endif
|
||||
|
||||
set incsearch
|
||||
|
||||
set hlsearch
|
||||
|
||||
set tabstop=4
|
||||
set shiftwidth=4
|
||||
set expandtab
|
||||
|
||||
set visualbell
|
||||
set noerrorbells
|
||||
|
||||
set backspace=indent,eol,start
|
||||
|
||||
set hidden
|
||||
set updatetime=250
|
||||
set lazyredraw " Do not redraw screen in the middle of a macro. Makes them complete faster.
|
||||
|
||||
set cursorcolumn
|
||||
|
||||
set splitbelow
|
||||
|
||||
" Turn off relativenumber only for insert mode.
|
||||
if has('nvim')
|
||||
set relativenumber
|
||||
augroup every
|
||||
autocmd!
|
||||
au InsertEnter * set norelativenumber
|
||||
au InsertLeave * set relativenumber
|
||||
augroup END
|
||||
endif
|
||||
|
||||
" 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 ' . myUndoDir)
|
||||
let &undodir = myUndoDir
|
||||
set undofile
|
||||
endif
|
||||
|
||||
syntax enable
|
||||
|
||||
" From http://stackoverflow.com/a/5004785/2766106
|
||||
set list
|
||||
set listchars=tab:╾╌,trail:·,extends:↦,precedes:↤,nbsp:_
|
||||
set showbreak=↪
|
||||
|
||||
filetype on
|
||||
filetype plugin on
|
||||
filetype indent on
|
||||
|
||||
set wildmode=longest:full,full
|
||||
set wildmenu
|
||||
set showcmd
|
||||
|
||||
" Completion
|
||||
|
||||
" Avoid showing message extra message when using completion
|
||||
set shortmess+=c
|
||||
|
||||
" 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
|
||||
cmap w!! w !sudo tee > /dev/null %
|
||||
|
||||
imap jk <Esc>
|
||||
vmap <Enter> <Esc>
|
||||
|
||||
nmap <Enter> o<Esc>
|
||||
nmap <C-H> :bp<CR>
|
||||
nmap <C-L> :bn<CR>
|
||||
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>\>/
|
||||
|
||||
" add extensions to syntax
|
||||
au BufNewFile,BufRead *.jinja set filetype=jinja2
|
||||
|
||||
command Reload source $MYVIMRC
|
||||
|
|
@ -1,18 +1,3 @@
|
|||
set nocompatible
|
||||
filetype on
|
||||
|
||||
" SET PATHS
|
||||
|
||||
set runtimepath+=~/.config/{{ variant }}
|
||||
let vimDir = '$HOME/.cache/{{ variant }}'
|
||||
call system('mkdir ' . vimDir)
|
||||
let &runtimepath.=','.vimDir
|
||||
set viminfo+=n~/.cache/{{ variant }}/viminfo
|
||||
|
||||
" EDITOR CONFIGURATION
|
||||
|
||||
{% include 'editor.j2' %}
|
||||
|
||||
" PLUGINS CONFIGURATION
|
||||
|
||||
{% include 'pluginconfig.j2' %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue