2017-12-28 13:49:45 +00:00
|
|
|
" Important stuff {{{
|
2018-04-04 18:12:51 +00:00
|
|
|
let g:loaded_python_provider=1 " Disable python 2 interface
|
|
|
|
let g:python_host_skip_check=1 " Skip python 2 host check
|
|
|
|
let g:python3_host_prog = '/usr/bin/python3'
|
|
|
|
let g:tagbar_ctags_bin = '/usr/bin/ctags'
|
|
|
|
set inccommand=nosplit " Live preview of substitutes and other similar commands
|
|
|
|
|
|
|
|
" Plug updates itself automatically
|
|
|
|
if empty(glob('~/.config/nvim/autoload/plug.vim'))
|
|
|
|
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
|
|
|
|
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
|
|
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
|
|
|
|
endif
|
2017-12-28 13:49:45 +00:00
|
|
|
" }}}
|
|
|
|
|
2018-01-22 05:32:55 +00:00
|
|
|
" Plugins {{{
|
2018-04-04 18:12:51 +00:00
|
|
|
call plug#begin('~/.config/nvim/plugged')
|
|
|
|
Plug 'junegunn/vim-plug'
|
|
|
|
Plug 'Shougo/deoplete.nvim', { 'do': [':UpdateRemotePlugins', ':set runtimepath+=~/.config/nvim/plugged/deoplete.nvim/'] }
|
|
|
|
Plug 'jiangmiao/auto-pairs'
|
|
|
|
Plug 'zchee/deoplete-jedi'
|
|
|
|
Plug 'w0rp/ale'
|
|
|
|
Plug 'sbdchd/neoformat'
|
|
|
|
Plug 'scrooloose/nerdtree', { 'on': ['NERDTreeFind', 'NERDTreeToggle'] }
|
|
|
|
Plug 'christoomey/vim-tmux-navigator'
|
|
|
|
Plug 'zefei/vim-wintabs'
|
|
|
|
Plug 'lervag/vimtex', { 'for': 'tex' }
|
|
|
|
"Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' }
|
|
|
|
Plug '/usr/bin/fzf'
|
|
|
|
Plug 'junegunn/fzf.vim'
|
|
|
|
|
|
|
|
call plug#end()
|
|
|
|
let g:plug_window = 'rightbelow topleft new'
|
2017-12-28 13:49:45 +00:00
|
|
|
" }}}
|
|
|
|
|
2018-01-24 19:32:47 +00:00
|
|
|
" Options {{{
|
2018-04-04 18:12:51 +00:00
|
|
|
" Search down int subfolders
|
|
|
|
" Provides tab-completion for all file-related tasks
|
|
|
|
" - :b lets you autocomplete any open buffer
|
|
|
|
set path+=**
|
|
|
|
|
|
|
|
let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1
|
|
|
|
"let $NVIM_TUI_ENABLE_TRUE_COLOR=1
|
|
|
|
|
|
|
|
set binary
|
|
|
|
set encoding=utf-8 " The encoding displayed.
|
|
|
|
set fileencoding=utf-8 " The encoding written to file.
|
|
|
|
scriptencoding utf-8 " Set utf-8 as default script encoding
|
|
|
|
let mapleader="\<SPACE>"
|
|
|
|
set shell=/bin/zsh " Setting shell to zsh
|
|
|
|
set number " Line numbers on
|
|
|
|
set showmode " Always show mode
|
|
|
|
set textwidth=120 " Text width is 120 characters
|
|
|
|
set cmdheight=1 " Command line height
|
|
|
|
set cmdwinheight=5 " Command-line lines
|
|
|
|
set pumheight=10 " Completion window max size
|
|
|
|
set helpheight=12 " Minimum help window height
|
|
|
|
set previewheight=12 " Completion preview height
|
|
|
|
set noswapfile " New buffers will be loaded without creating a swapfile
|
|
|
|
set hidden " Enables to switch between unsaved buffers and keep undo history
|
|
|
|
set lazyredraw " Don't redraw while executing macros (better performance)
|
|
|
|
set showmatch " Show matching brackets when text indicator is over them
|
|
|
|
set matchtime=2 " How many tenths of a second to blink when matching brackets
|
|
|
|
set nojoinspaces " No extra space when joining a line which ends with . ? !
|
|
|
|
set updatetime=1000 " Update time used to create swap file or other things
|
|
|
|
set synmaxcol=220 " Don't try to syntax highlight minified files
|
|
|
|
set splitbelow " Splitting a window will put the new window below the current
|
|
|
|
set splitright " Splitting a window will put the new window right of the current
|
|
|
|
set notimeout " Time out on key codes but not mappings.
|
|
|
|
set ttimeout
|
|
|
|
set ttimeoutlen=10
|
|
|
|
set ignorecase " Ignore case by default
|
|
|
|
set smartcase " Make search case sensitive only if it contains uppercase letters
|
|
|
|
set wrapscan " Search again from top when reached the bottom
|
|
|
|
set cursorline " Hightlight the screen line of the cursor
|
|
|
|
set numberwidth=5 " Minimal number of columns to use for line numbers
|
|
|
|
set nobackup
|
|
|
|
set nowritebackup
|
|
|
|
set wrap " Wrap lines longer than the width of the window
|
|
|
|
set visualbell " Use visual bell instead of beeping
|
|
|
|
set selectmode=key
|
|
|
|
set keymodel=startsel
|
|
|
|
set foldenable " Fold by default
|
|
|
|
set foldlevelstart=10
|
|
|
|
set foldnestmax=10 " Deepest fold is 10 levels
|
|
|
|
set foldmethod=marker " Markers are used to specify folds.
|
|
|
|
set completeopt-=preview " Don't show preview scratch buffers
|
|
|
|
set noexpandtab " Do not turn tabs into spaces
|
|
|
|
set tabstop=4 " Number of spaces a <Tab> equals
|
|
|
|
set softtabstop=4
|
|
|
|
set shiftwidth=4 " Number of spaces for each (auto)indent step
|
|
|
|
set foldclose=all
|
|
|
|
set nostartofline
|
|
|
|
set nosmartindent
|
|
|
|
set laststatus=1 " Status line on 2 or more files
|
|
|
|
set nosmarttab
|
|
|
|
set modeline
|
|
|
|
set modelines=2
|
|
|
|
set scrolloff=7 " Keep this many lines padding when scrolling
|
|
|
|
set undofile
|
|
|
|
set undolevels=1000
|
|
|
|
set undoreload=10000
|
|
|
|
set undodir=$HOME/.config/nvim/undo
|
|
|
|
set termguicolors
|
|
|
|
set fillchars="fold: " " Characters to fill the statuslines and vertical separators
|
|
|
|
set fillchars+=vert:\│
|
|
|
|
set nrformats-=octal
|
|
|
|
set pastetoggle=<F12>
|
|
|
|
set shortmess=aoOtIWcFs " Shorten messages and don't show intro
|
|
|
|
set omnifunc=syntaxcomplete#Complete
|
|
|
|
set complete+=]
|
|
|
|
set completeopt-=preview
|
|
|
|
set completeopt+=noinsert,longest,noselect,menuone
|
|
|
|
set formatoptions+=n
|
2018-05-26 20:06:45 +00:00
|
|
|
let formatlistpat='^\s*\(\d\+[\]:.)}\t ]\|[*-][\t ]\)\s*'
|
2018-04-04 18:12:51 +00:00
|
|
|
|
|
|
|
" Display all matching files when we tab complete
|
|
|
|
set wildmenu
|
|
|
|
set wildignorecase
|
|
|
|
set wildoptions=tagfile
|
|
|
|
set wildignore+=.git,.hg,.svn
|
|
|
|
set wildignore+=*.aux,*.out,*.toc
|
|
|
|
set wildignore+=*.o,*.obj,*.exe,*.dll,*.manifest,*.rbc,*.class
|
|
|
|
set wildignore+=*.ai,*.bmp,*.gif,*.ico,*.jpg,*.jpeg,*.png,*.psd,*.webp
|
|
|
|
set wildignore+=*.avi,*.divx,*.mp4,*.webm,*.mov,*.m2ts,*.mkv,*.vob,*.mpg,*.mpeg
|
|
|
|
set wildignore+=*.mp3,*.oga,*.ogg,*.wav,*.flac
|
|
|
|
set wildignore+=*.eot,*.otf,*.ttf,*.woff
|
|
|
|
set wildignore+=*.doc,*.pdf,*.cbr,*.cbz
|
|
|
|
set wildignore+=*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz,*.kgb
|
|
|
|
set wildignore+=*.swp,.lock,.DS_Store,._*
|
|
|
|
set wildignore+=.stversions,*.pyc,*.spl,*.o,*.out,*~,%*
|
|
|
|
set wildignore+=*vim/backups*
|
|
|
|
set wildignore+=tmp/**
|
|
|
|
set wildignore+=*.gem
|
|
|
|
set wildignore+=log/**
|
|
|
|
set wildignore+=*cache*
|
|
|
|
set wildignore+=*logs*
|
|
|
|
set wildignore+=*node_modules/**
|
|
|
|
set wildignore+=__pycache__,*.egg-info
|
|
|
|
set wildmode=longest:list,full
|
|
|
|
|
|
|
|
match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$'
|
|
|
|
highlight TermCursor ctermfg=green guifg=green
|
|
|
|
colorscheme turtles
|
2018-01-30 04:25:41 +00:00
|
|
|
" }}}
|
|
|
|
|
2018-04-04 18:12:51 +00:00
|
|
|
" Statusline {{{
|
|
|
|
function! GitBranch()
|
|
|
|
return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! StatuslineGit()
|
|
|
|
let l:branchname = GitBranch()
|
|
|
|
return strlen(l:branchname) > 0?' '.l:branchname.' ':''
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! PasteForStatusline()
|
|
|
|
let paste_status = &paste
|
|
|
|
if paste_status == 1
|
|
|
|
return " [paste] "
|
|
|
|
else
|
|
|
|
return ""
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! LinterStatus() abort
|
|
|
|
let l:counts = ale#statusline#Count(bufnr(''))
|
|
|
|
|
|
|
|
let l:all_errors = l:counts.error + l:counts.style_error
|
|
|
|
let l:all_non_errors = l:counts.total - l:all_errors
|
|
|
|
|
|
|
|
return l:counts.total == 0 ? 'OK' : printf(
|
|
|
|
\ '%dW %dE',
|
|
|
|
\ all_non_errors,
|
|
|
|
\ all_errors
|
|
|
|
\)
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
set statusline=
|
|
|
|
set statusline+=%#SpecialKey#
|
|
|
|
set statusline+=\ %{StatuslineGit()}
|
|
|
|
set statusline+=%#CursorLineNr#
|
|
|
|
set statusline+=\ %F
|
|
|
|
set statusline+=\ %y
|
|
|
|
set statusline+=\ %h%m%r%w%q
|
|
|
|
set statusline+=%=
|
|
|
|
set statusline+=%{LinterStatus()}
|
|
|
|
set statusline+=%{PasteForStatusline()}
|
|
|
|
set statusline+=\ %{&fileencoding?&fileencoding:&encoding}
|
|
|
|
set statusline+=\ [%{&fileformat}\]
|
|
|
|
set statusline+=\ %l:%c\ (%p%%)
|
|
|
|
set statusline+=%#Keyword#
|
|
|
|
set statusline+=\ %{winnr()}
|
|
|
|
set statusline+=
|
2018-01-30 04:25:41 +00:00
|
|
|
" }}}
|
|
|
|
|
2018-02-04 16:14:51 +00:00
|
|
|
" AutoCommands {{{
|
2018-04-04 18:12:51 +00:00
|
|
|
if !exists("autocommands_loaded") && has("autocmd")
|
|
|
|
let autocommands_loaded = 1
|
|
|
|
|
|
|
|
autocmd BufWritePre * :%s/\s\+$//e " Auto remove all trailing whitespace on :w
|
|
|
|
:au FocusLost * :wa " Autosave files when focus is lost
|
|
|
|
|
|
|
|
" Disables automatic commenting on newline
|
|
|
|
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
|
|
|
|
|
|
|
|
" Automatic syntax highlighting for files
|
|
|
|
aug set_file_types
|
|
|
|
au BufRead,BufNewFile *.txt set filetype=markdown
|
|
|
|
au BufRead,BufNewFile *.md set filetype=markdown
|
|
|
|
au BufRead,BufNewFile *.conf set filetype=dosini
|
|
|
|
au BufRead,BufNewFile *.bash* set filetype=sh
|
|
|
|
aug END
|
|
|
|
endif
|
2018-02-04 16:14:51 +00:00
|
|
|
"}}}
|
|
|
|
|
2018-01-30 04:25:41 +00:00
|
|
|
" Read-Only files {{{
|
2018-04-04 18:12:51 +00:00
|
|
|
if &readonly
|
|
|
|
set laststatus=0
|
|
|
|
set ruler
|
|
|
|
set cmdheight=1
|
|
|
|
set nonumber
|
|
|
|
set noshowmode
|
|
|
|
set colorcolumn=0
|
|
|
|
endif
|
2017-12-28 13:49:45 +00:00
|
|
|
" }}}
|
|
|
|
|
|
|
|
" Tweaks for browsing {{{
|
2018-04-04 18:12:51 +00:00
|
|
|
" - :edit a folder to open a file browser
|
|
|
|
" - <CR>/v/t to open in an h-split/v-split/tab
|
|
|
|
let g:netrw_banner=0 " disable annoying banner
|
|
|
|
let g:netrw_browse_split=4 " open in prior window
|
|
|
|
let g:netrw_altv=1 " open splits to the right
|
|
|
|
let g:netrw_liststyle=3 " tree view
|
|
|
|
let g:netrw_list_hide=netrw_gitignore#Hide()
|
|
|
|
let g:netrw_list_hide.=',\(^\|\s\s\)\zs\.\S\+'
|
|
|
|
let g:netrw_winsize=25
|
2017-12-28 13:49:45 +00:00
|
|
|
" }}}
|
|
|
|
|
2018-03-01 04:34:41 +00:00
|
|
|
" {{{ Ale
|
2018-04-04 18:12:51 +00:00
|
|
|
let g:ale_echo_msg_error_str = 'E'
|
|
|
|
let g:ale_echo_msg_warning_str = 'W'
|
|
|
|
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
|
|
|
|
hi ALEErrorSign ctermfg=red ctermbg=none
|
|
|
|
hi ALEWarningSign ctermfg=yellow ctermbg=none
|
2018-03-01 04:34:41 +00:00
|
|
|
" }}}
|
|
|
|
|
|
|
|
" Deoplete {{{
|
2018-04-04 18:12:51 +00:00
|
|
|
let g:deoplete#enable_at_startup = 1
|
|
|
|
let g:deoplete#sources#jedi#show_docstring = 1
|
|
|
|
let g:deoplete#enable_ignore_case = 1
|
|
|
|
let g:deoplete#enable_smart_case = 1
|
|
|
|
let g:context_filetype#same_filetypes = {}
|
|
|
|
let g:context_filetype#same_filetypes._ = '_'
|
2018-03-01 04:34:41 +00:00
|
|
|
"}}}
|
|
|
|
|
2018-01-25 23:37:48 +00:00
|
|
|
" FZF {{{
|
2018-04-04 18:12:51 +00:00
|
|
|
" An action can be a reference to a function that processes selected lines
|
|
|
|
function! s:build_quickfix_list(lines)
|
|
|
|
call setqflist(map(copy(a:lines), '{ "filename": v:val }'))
|
|
|
|
copen
|
|
|
|
cc
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
let g:fzf_action = {
|
|
|
|
\ 'ctrl-q': function('s:build_quickfix_list'),
|
|
|
|
\ 'ctrl-t': 'tab split',
|
|
|
|
\ 'ctrl-x': 'split',
|
|
|
|
\ 'ctrl-v': 'vsplit' }
|
|
|
|
|
|
|
|
"let $FZF_DEFAULT_OPTS .= ' --no-height'
|
|
|
|
|
|
|
|
" Default fzf layout: - down / up / left / right
|
|
|
|
let g:fzf_layout = { 'down': '~40%' }
|
|
|
|
|
|
|
|
" You can set up fzf window using a Vim command
|
|
|
|
let g:fzf_layout = { 'window': 'enew' }
|
|
|
|
let g:fzf_layout = { 'window': '-tabnew' }
|
|
|
|
"let g:fzf_layout = { 'window': '10split enew' }
|
|
|
|
|
|
|
|
" Customize fzf colors to match your color scheme
|
|
|
|
let g:fzf_colors =
|
|
|
|
\ { 'fg': ['fg', 'Normal'],
|
|
|
|
\ 'bg': ['bg', 'Normal'],
|
|
|
|
\ 'hl': ['fg', 'Comment'],
|
|
|
|
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
|
|
|
|
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
|
|
|
|
\ 'hl+': ['fg', 'Statement'],
|
|
|
|
\ 'info': ['fg', 'PreProc'],
|
|
|
|
\ 'border': ['fg', 'Ignore'],
|
|
|
|
\ 'prompt': ['fg', 'Conditional'],
|
|
|
|
\ 'pointer': ['fg', 'Exception'],
|
|
|
|
\ 'marker': ['fg', 'Keyword'],
|
|
|
|
\ 'spinner': ['fg', 'Label'],
|
|
|
|
\ 'header': ['fg', 'Comment'] }
|
|
|
|
|
|
|
|
" Enable per-command history.
|
|
|
|
" CTRL-N and CTRL-P will be automatically bound to next-history and
|
|
|
|
" previous-history instead of down and up. If you don't like the change,
|
|
|
|
" explicitly bind the keys to down and up in your $FZF_DEFAULT_OPTS.
|
|
|
|
let g:fzf_history_dir = '~/.local/share/fzf-history'
|
|
|
|
|
|
|
|
function! s:fzf_statusline()
|
|
|
|
highlight fzf1 ctermfg=161 ctermbg=251
|
|
|
|
highlight fzf2 ctermfg=23 ctermbg=251
|
|
|
|
highlight fzf3 ctermfg=237 ctermbg=251
|
|
|
|
setlocal statusline=%#fzf1#\ >\ %#fzf2#fz%#fzf3#f
|
|
|
|
endfunction
|
|
|
|
autocmd! User FzfStatusLine call <SID>fzf_statusline()
|
|
|
|
|
|
|
|
" [Buffers] Jump to the existing window if possible
|
|
|
|
let g:fzf_buffers_jump = 1
|
|
|
|
|
|
|
|
" [Commands] --expect expression for directly executing the command
|
|
|
|
let g:fzf_commands_expect = 'alt-enter,ctrl-x'
|
|
|
|
|
|
|
|
" Override Colors command. You can safely do this in your .vimrc as fzf.vim
|
|
|
|
" will not override existing commands.
|
|
|
|
command! -bang Colors
|
|
|
|
\ call fzf#vim#colors({'left': '15%', 'options': '--reverse --margin 30%,0'}, <bang>0)
|
|
|
|
|
|
|
|
" :Ag - Start fzf
|
|
|
|
" :Ag! - Start fzf in fullscreen and display the preview window above
|
|
|
|
command! -bang -nargs=* Ag
|
|
|
|
\ call fzf#vim#ag(<q-args>,
|
|
|
|
\ <bang>0 ? fzf#vim#with_preview('up:60%')
|
|
|
|
\ : fzf#vim#with_preview('right:50%'),
|
|
|
|
\ <bang>0)
|
|
|
|
|
|
|
|
" Likewise, Files command with preview window
|
|
|
|
command! -bang -nargs=? -complete=dir Files
|
|
|
|
\ call fzf#vim#files(<q-args>, fzf#vim#with_preview(), <bang>0)
|
2018-01-02 16:13:44 +00:00
|
|
|
" }}}
|
|
|
|
|
2018-02-04 16:14:51 +00:00
|
|
|
" Wintabs {{{
|
2018-04-04 18:12:51 +00:00
|
|
|
let g:wintabs_ui_active_higroup = 'TabLineSel'
|
|
|
|
let g:wintabs_switchbuf='useopen,usetab'
|
|
|
|
let intertabSpace= ' '
|
|
|
|
let activeWinTabChar = '|'
|
|
|
|
let activeVimTabChar = '|'
|
|
|
|
let activeWinTabChar = '▎'
|
|
|
|
let activeVimTabChar = '▍'
|
|
|
|
let g:wintabs_ui_sep_leftmost=intertabSpace
|
|
|
|
let g:wintabs_ui_sep_inbetween=intertabSpace
|
|
|
|
let g:wintabs_ui_active_right=intertabSpace
|
|
|
|
let g:wintabs_ui_active_left=activeVimTabChar
|
|
|
|
let g:wintabs_ui_sep_rightmost=intertabSpace
|
|
|
|
let g:wintabs_ui_modified=' +'
|
|
|
|
let g:wintabs_ignored_filetypes=[]
|
|
|
|
let g:wintabs_ui_active_vimtab_left=activeVimTabChar
|
|
|
|
let g:wintabs_ui_active_vimtab_right=intertabSpace
|
|
|
|
|
|
|
|
let g:wintabs_ui_arrow_left='«'
|
|
|
|
let g:wintabs_ui_arrow_right='»'
|
2018-02-04 16:14:51 +00:00
|
|
|
" }}}
|
|
|
|
|
2017-12-28 13:49:45 +00:00
|
|
|
" NerdTree {{{
|
2018-04-04 18:12:51 +00:00
|
|
|
autocmd StdinReadPre * let s:std_in=1
|
|
|
|
let NERDTreeIgnore=['\.rbc$', '\~$', '\.pyc$', '\.pyo$', '\.db$', '\.sqlite$', '.o$', 'bower_components', 'node_modules', '__pycache__']
|
|
|
|
let g:NERDTreeSortOrder=['^__\.py$', '\/$', '*', '\.swp$', '\.bak$', '\~$']
|
|
|
|
let NERDTreeNaturalSort = 1
|
|
|
|
let NERDTreeShowHidden=1
|
|
|
|
let NERDTreeWinPos=1
|
|
|
|
let NERDTreeRespectWildIgnore = 1
|
|
|
|
let NERDTreeMinimalUI=1
|
|
|
|
let NERDTreeDirArrows = 1
|
|
|
|
let NERDTreeCascadeSingleChildDir=1
|
|
|
|
let NERDTreeCascadeOpenSingleChildDir=1
|
|
|
|
let NERDTreeQuitOnOpen = 1
|
|
|
|
let NERDTreeHijackNetrw = 0
|
|
|
|
let NERDTreeAutoCenter = 1
|
2017-12-28 13:49:45 +00:00
|
|
|
" }}}
|
|
|
|
|
|
|
|
" Tmux navigator {{{
|
2018-04-04 18:12:51 +00:00
|
|
|
let g:tmux_navigator_no_mappings = 1
|
|
|
|
let g:tmux_navigator_save_on_switch = 1
|
|
|
|
nnoremap <silent> M-left :TmuxNavigateLeft<cr>
|
|
|
|
nnoremap <silent> M-Down :TmuxNavigateDown<cr>
|
|
|
|
nnoremap <silent> M-Up :TmuxNavigateUp<cr>
|
|
|
|
nnoremap <silent> M-Right :TmuxNavigateRight<cr>
|
|
|
|
nnoremap <silent> M-Tab :TmuxNavigatePrevious<cr>
|
2017-12-28 13:49:45 +00:00
|
|
|
" }}}
|
|
|
|
|
|
|
|
" Mappings {{{
|
2018-04-04 18:12:51 +00:00
|
|
|
map <F9> :!w<Enter>:!pdflatex <C-r>%<Enter>
|
|
|
|
map <F6> :setlocal spell! spelllang=es<CR>
|
|
|
|
map <F7> :setlocal spell! spelllang=en<CR>
|
|
|
|
|
|
|
|
nmap <silent> <F10> <Plug>(ale_previous_wrap)
|
|
|
|
nmap <silent> <F11> <Plug>(ale_next_wrap)
|
|
|
|
|
|
|
|
nnoremap <leader>f :Neoformat<CR>
|
|
|
|
vnoremap <leader>f :Neoformat<CR>
|
|
|
|
|
|
|
|
" FZF really is a lifechanger
|
|
|
|
nnoremap <F4> :FZF<CR>
|
|
|
|
nnoremap <leader>b :Buffers<cr>
|
2018-05-26 20:06:45 +00:00
|
|
|
nnoremap <leader>h :History:<cr>
|
2018-04-04 18:12:51 +00:00
|
|
|
nnoremap <leader>t :Files<cr>
|
|
|
|
nnoremap <leader>gt :GFiles<cr>
|
|
|
|
nnoremap <leader>l :Lines<cr>
|
|
|
|
nnoremap <leader>m :Maps<cr>
|
|
|
|
nnoremap <leader>r :Ag<cr>
|
|
|
|
|
|
|
|
" Mapping selecting mappings
|
|
|
|
nmap <leader><tab> <plug>(fzf-maps-n)
|
|
|
|
xmap <leader><tab> <plug>(fzf-maps-x)
|
|
|
|
omap <leader><tab> <plug>(fzf-maps-o)
|
|
|
|
|
|
|
|
" Insert mode completion
|
|
|
|
imap <c-x><c-k> <plug>(fzf-complete-word)
|
|
|
|
imap <c-x><c-f> <plug>(fzf-complete-path)
|
|
|
|
imap <c-x><c-j> <plug>(fzf-complete-file-ag)
|
|
|
|
imap <c-x><c-l> <plug>(fzf-complete-line)
|
|
|
|
|
|
|
|
nnoremap <silent> <F3> :NERDTreeFind<CR>
|
|
|
|
nnoremap <silent> <F2> :NERDTreeToggle<CR>
|
2018-05-26 20:06:45 +00:00
|
|
|
nnoremap <leader>pi :PlugInstall<CR>
|
|
|
|
nnoremap <leader>pu :PlugUpdate<CR>
|
|
|
|
nnoremap <leader>pU :PlugUpgrade<CR>
|
|
|
|
nnoremap <leader>pc :PlugClean<CR>
|
2018-04-04 18:12:51 +00:00
|
|
|
|
|
|
|
" super quick search and replace
|
|
|
|
nnoremap <Space>' :'{,'}s/\<<C-r>=expand("<cword>")<CR>\>/
|
|
|
|
nnoremap <Space>¿ :%s/\<<C-r>=expand("<cword>")<CR>\>/
|
|
|
|
|
|
|
|
" Learn vim keys the hard way
|
|
|
|
nnoremap <silent> <Left> :vertical resize -2<CR>
|
|
|
|
nnoremap <silent> <Right> :vertical resize +2<CR>
|
|
|
|
nnoremap <silent> <Up> :resize -2<CR>
|
|
|
|
nnoremap <silent> <Down> :resize +2<CR>
|
|
|
|
|
|
|
|
nnoremap <silent> <F5> :so ~/.config/nvim/init.vim<CR>
|
|
|
|
nnoremap <leader>T :terminal<CR>
|
|
|
|
nnoremap <leader>s :split<CR>
|
|
|
|
nnoremap <leader>v :vsplit<CR>
|
|
|
|
nnoremap <leader>nv :vnew<CR>
|
|
|
|
nnoremap <leader>ns :new<CR>
|
|
|
|
|
|
|
|
" ensure that ctrl+u in insert mode can be reversed
|
|
|
|
" http://vim.wikia.com/wiki/Recover_from_accidental_Ctrl-U
|
|
|
|
inoremap <c-u> <c-g>u<c-u>
|
|
|
|
inoremap <c-w> <c-g>u<c-w>
|
|
|
|
|
|
|
|
" My vim wants to enter all the time, enter all the time
|
|
|
|
nnoremap <silent> <CR> i<CR><ESC>
|
|
|
|
|
|
|
|
" Fix indentation
|
|
|
|
nnoremap <leader>i mzgg=G`z<CR>
|
|
|
|
|
|
|
|
" Unhighlight search terms
|
2018-07-04 19:27:13 +00:00
|
|
|
nnoremap <silent> <leader><space> :noh<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L>
|
2018-04-04 18:12:51 +00:00
|
|
|
|
|
|
|
" What about the Q
|
|
|
|
nnoremap Q <nop>
|
|
|
|
map q <nop>
|
|
|
|
|
|
|
|
" Move vertically by visual line
|
|
|
|
nnoremap j gj
|
|
|
|
nnoremap k gk
|
|
|
|
vnoremap j gj
|
|
|
|
vnoremap k gk
|
|
|
|
|
|
|
|
" Use tab for indenting in visual mode
|
|
|
|
vnoremap <Tab> >gv|
|
|
|
|
vnoremap <S-Tab> <gv
|
|
|
|
|
|
|
|
noremap <silent> <Home> g<Home>
|
|
|
|
noremap <silent> <End> g<End>
|
|
|
|
inoremap <silent> <Home> <C-o>g<Home>
|
|
|
|
inoremap <silent> <End> <C-o>g<End>
|
|
|
|
noremap Y y$
|
|
|
|
|
|
|
|
" Center screen when jumping and moving
|
|
|
|
nnoremap <silent> n :norm! nzz<CR>
|
|
|
|
nnoremap <silent> N :norm! Nzz<CR>
|
|
|
|
vnoremap <silent> n :norm! nzz<CR>
|
|
|
|
vnoremap <silent> N :norm! Nzz<CR>
|
|
|
|
nnoremap <C-u> <C-u>zz
|
|
|
|
nnoremap <C-d> <C-d>zz
|
|
|
|
nnoremap <C-f> <C-f>zz
|
|
|
|
nnoremap <C-b> <C-b>zz
|
|
|
|
vnoremap <C-u> <C-u>zz
|
|
|
|
vnoremap <C-d> <C-d>zz
|
|
|
|
vnoremap <C-f> <C-f>zz
|
|
|
|
vnoremap <C-b> <C-b>zz
|
|
|
|
|
|
|
|
" Tabs
|
|
|
|
nnoremap <C-Tab> :tabnew<CR>
|
2018-07-04 19:27:13 +00:00
|
|
|
nnoremap <M-Tab> <Plug>(wintabs_close)<CR>
|
|
|
|
nnoremap <Tab> <Plug>(wintabs_next)<CR>
|
|
|
|
nnoremap <S-Tab> <<Plug>(wintabs_previous)<CR>
|
2018-04-04 18:12:51 +00:00
|
|
|
|
|
|
|
" Alt to switch windows
|
|
|
|
nnoremap <M-j> <C-W><C-J>
|
|
|
|
nnoremap <M-k> <C-W><C-K>
|
|
|
|
nnoremap <M-l> <C-W><C-L>
|
|
|
|
nnoremap <M-h> <C-W><C-H>
|
|
|
|
|
|
|
|
" Terminal movement
|
|
|
|
tnoremap <Esc> <C-\><C-n>
|
|
|
|
tnoremap <M-h> <C-\><C-n><C-w>h
|
|
|
|
tnoremap <M-j> <C-\><C-n><C-w>j
|
|
|
|
tnoremap <M-k> <C-\><C-n><C-w>k
|
|
|
|
tnoremap <M-l> <C-\><C-n><C-w>l
|
|
|
|
|
|
|
|
" Shift butterfinger
|
|
|
|
:command! WQ wq
|
|
|
|
:command! Wq wq
|
|
|
|
:command! Wqa wqa
|
|
|
|
:command! Wa wa
|
|
|
|
:command! WA wa
|
|
|
|
:command! W w
|
|
|
|
:command! Q q
|
|
|
|
:command! Qa qa
|
|
|
|
:command! QA qa
|
2018-01-24 19:32:47 +00:00
|
|
|
" }}}
|
|
|
|
|
2018-04-04 18:12:51 +00:00
|
|
|
" vim:foldmethod=marker:foldlevel=0
|