summaryrefslogtreecommitdiff
path: root/.config/nvim
diff options
context:
space:
mode:
authorVito Graffagnino <vito@graffagnino.xyz>2020-09-09 14:53:26 +0100
committerVito Graffagnino <vito@graffagnino.xyz>2020-09-09 14:53:26 +0100
commit0d16d52492938dd92591b1278a73d50ef388c633 (patch)
tree2f342456a71b8c52dab89cb0311d033c24e54896 /.config/nvim
parent3b0142cedcde39e4c2097ecd916a870a3ced5ec6 (diff)
update/modularised nvim config files
Diffstat (limited to '.config/nvim')
-rw-r--r--.config/nvim/autoload/plug.vim115
-rw-r--r--.config/nvim/coc-settings.json73
-rw-r--r--.config/nvim/general/functions.vim9
-rw-r--r--.config/nvim/general/paths.vim4
-rw-r--r--.config/nvim/general/settings.vim45
-rw-r--r--[-rwxr-xr-x].config/nvim/init.vim721
-rw-r--r--.config/nvim/keys/mappings.vim73
-rw-r--r--.config/nvim/keys/which-key.vim170
-rw-r--r--.config/nvim/plug-config/coc.vim157
-rw-r--r--.config/nvim/themes/airline.vim34
-rw-r--r--.config/nvim/themes/onedark.vim23
-rw-r--r--.config/nvim/vim-plug/plugins.vim49
12 files changed, 733 insertions, 740 deletions
diff --git a/.config/nvim/autoload/plug.vim b/.config/nvim/autoload/plug.vim
index c29b9a2..9262208 100644
--- a/.config/nvim/autoload/plug.vim
+++ b/.config/nvim/autoload/plug.vim
@@ -116,6 +116,90 @@ let s:TYPE = {
let s:loaded = get(s:, 'loaded', {})
let s:triggers = get(s:, 'triggers', {})
+function! s:isabsolute(dir) abort
+ return a:dir =~# '^/' || (has('win32') && a:dir =~? '^\%(\\\|[A-Z]:\)')
+endfunction
+
+function! s:git_dir(dir) abort
+ let gitdir = s:trim(a:dir) . '/.git'
+ if isdirectory(gitdir)
+ return gitdir
+ endif
+ if !filereadable(gitdir)
+ return ''
+ endif
+ let gitdir = matchstr(get(readfile(gitdir), 0, ''), '^gitdir: \zs.*')
+ if len(gitdir) && !s:isabsolute(gitdir)
+ let gitdir = a:dir . '/' . gitdir
+ endif
+ return isdirectory(gitdir) ? gitdir : ''
+endfunction
+
+function! s:git_origin_url(dir) abort
+ let gitdir = s:git_dir(a:dir)
+ let config = gitdir . '/config'
+ if empty(gitdir) || !filereadable(config)
+ return ''
+ endif
+ return matchstr(join(readfile(config)), '\[remote "origin"\].\{-}url\s*=\s*\zs\S*\ze')
+endfunction
+
+function! s:git_revision(dir) abort
+ let gitdir = s:git_dir(a:dir)
+ let head = gitdir . '/HEAD'
+ if empty(gitdir) || !filereadable(head)
+ return ''
+ endif
+
+ let line = get(readfile(head), 0, '')
+ let ref = matchstr(line, '^ref: \zs.*')
+ if empty(ref)
+ return line
+ endif
+
+ if filereadable(gitdir . '/' . ref)
+ return get(readfile(gitdir . '/' . ref), 0, '')
+ endif
+
+ if filereadable(gitdir . '/packed-refs')
+ for line in readfile(gitdir . '/packed-refs')
+ if line =~# ' ' . ref
+ return matchstr(line, '^[0-9a-f]*')
+ endif
+ endfor
+ endif
+
+ return ''
+endfunction
+
+function! s:git_local_branch(dir) abort
+ let gitdir = s:git_dir(a:dir)
+ let head = gitdir . '/HEAD'
+ if empty(gitdir) || !filereadable(head)
+ return ''
+ endif
+ let branch = matchstr(get(readfile(head), 0, ''), '^ref: refs/heads/\zs.*')
+ return len(branch) ? branch : 'HEAD'
+endfunction
+
+function! s:git_origin_branch(spec)
+ if len(a:spec.branch)
+ return a:spec.branch
+ endif
+
+ " The file may not be present if this is a local repository
+ let gitdir = s:git_dir(a:spec.dir)
+ let origin_head = gitdir.'/refs/remotes/origin/HEAD'
+ if len(gitdir) && filereadable(origin_head)
+ return matchstr(get(readfile(origin_head), 0, ''),
+ \ '^ref: refs/remotes/origin/\zs.*')
+ endif
+
+ " The command may not return the name of a branch in detached HEAD state
+ let result = s:lines(s:system('git symbolic-ref --short HEAD', a:spec.dir))
+ return v:shell_error ? '' : result[-1]
+endfunction
+
if s:is_win
function! s:plug_call(fn, ...)
let shellslash = &shellslash
@@ -991,8 +1075,8 @@ endfunction
function! s:checkout(spec)
let sha = a:spec.commit
- let output = s:system(['git', 'rev-parse', 'HEAD'], a:spec.dir)
- if !v:shell_error && !s:hash_match(sha, s:lines(output)[0])
+ let output = s:git_revision(a:spec.dir)
+ if !empty(output) && !s:hash_match(sha, s:lines(output)[0])
let output = s:system(
\ 'git fetch --depth 999999 && git checkout '.plug#shellescape(sha).' --', a:spec.dir)
endif
@@ -2208,37 +2292,20 @@ function! s:system_chomp(...)
return v:shell_error ? '' : substitute(ret, '\n$', '', '')
endfunction
-function! s:git_origin_branch(spec)
- if len(a:spec.branch)
- return a:spec.branch
- endif
-
- " The file may not be present if this is a local repository
- let origin_head = a:spec.dir.'/.git/refs/remotes/origin/HEAD'
- if filereadable(origin_head)
- return split(readfile(origin_head)[0], 'refs/remotes/origin/')[-1]
- endif
-
- " The command may not return the name of a branch in detached HEAD state
- let result = s:lines(s:system('git symbolic-ref --short HEAD', a:spec.dir))
- return v:shell_error ? '' : result[-1]
-endfunction
-
function! s:git_validate(spec, check_branch)
let err = ''
if isdirectory(a:spec.dir)
- let result = s:lines(s:system('git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url', a:spec.dir))
+ let result = [s:git_local_branch(a:spec.dir), s:git_origin_url(a:spec.dir)]
let remote = result[-1]
- if v:shell_error
+ if empty(remote)
let err = join([remote, 'PlugClean required.'], "\n")
elseif !s:compare_git_uri(remote, a:spec.uri)
let err = join(['Invalid URI: '.remote,
\ 'Expected: '.a:spec.uri,
\ 'PlugClean required.'], "\n")
elseif a:check_branch && has_key(a:spec, 'commit')
- let result = s:lines(s:system('git rev-parse HEAD 2>&1', a:spec.dir))
- let sha = result[-1]
- if v:shell_error
+ let sha = s:git_revision(a:spec.dir)
+ if empty(sha)
let err = join(add(result, 'PlugClean required.'), "\n")
elseif !s:hash_match(sha, a:spec.commit)
let err = join([printf('Invalid HEAD (expected: %s, actual: %s)',
@@ -2683,7 +2750,7 @@ function! s:snapshot(force, ...) abort
let names = sort(keys(filter(copy(g:plugs),
\'has_key(v:val, "uri") && !has_key(v:val, "commit") && isdirectory(v:val.dir)')))
for name in reverse(names)
- let sha = s:system_chomp(['git', 'rev-parse', '--short', 'HEAD'], g:plugs[name].dir)
+ let sha = s:git_revision(g:plugs[name].dir)
if !empty(sha)
call append(anchor, printf("silent! let g:plugs['%s'].commit = '%s'", name, sha))
redraw
diff --git a/.config/nvim/coc-settings.json b/.config/nvim/coc-settings.json
new file mode 100644
index 0000000..a11d575
--- /dev/null
+++ b/.config/nvim/coc-settings.json
@@ -0,0 +1,73 @@
+{
+ // suggestions
+ // "suggest.echodocSupport": true,
+ // TODO add more labels and give them cool glyphs
+ "suggest.completionItemKindLabels": {
+ "text": "t",
+ "method": "m",
+ "function": "f"
+ },
+
+ // diagnostics
+ "diagnostic.errorSign": "✗",
+ "diagnostic.warningSign": "⚠",
+ "diagnostic.infoSign": "",
+ "diagnostic.hintSign": " ",
+ // "diagnostic.displayByAle": true,
+
+ // codelens TODO what does this get me?
+ // "codeLens.enable": true,
+
+ // list
+ "list.indicator": ">",
+ "list.selectedSignText": " ",
+
+ // autoformat
+ "coc.preferences.formatOnSaveFiletypes": [
+ "css",
+ "markdown",
+ "javascript",
+ "html",
+ "yaml",
+ "json",
+ "python"
+ ],
+ "coc.preferences.hoverTarget": "float",
+
+ // python config
+ "python.linting.enabled": true,
+ "python.linting.pylintEnabled": true,
+
+ // snippets
+ "snippets.ultisnips.directories": ["UltiSnips", "~/.config/nvim/utils/snips"],
+
+ // explorer
+ "explorer.width": 30,
+ "explorer.icon.enableNerdfont": true,
+ "explorer.previewAction.onHover": false,
+ "explorer.icon.enableVimDevicons": false,
+ "explorer.keyMappings": {
+ "<cr>": ["expandable?", "expand", "open"],
+ "v": "open:vsplit"
+ },
+
+ "languageserver": {
+ "bash": {
+ "command": "bash-language-server",
+ "args": ["start"],
+ "filetypes": ["sh"],
+ "ignoredRootPaths": ["~"]
+ },
+ "clangd": {
+ "command": "clangd",
+ "rootPatterns": ["compile_flags.txt", "compile_commands.json"],
+ "filetypes": ["c", "cc", "cpp", "c++", "objc", "objcpp"]
+ }
+
+ }
+
+ // TODO language servers
+ // TODO g:coc_global_extensions
+ // TODO b:coc_suggest_disable=1 GOYO
+ // TODO add to paths.vim g:coc_node_path
+}
diff --git a/.config/nvim/general/functions.vim b/.config/nvim/general/functions.vim
new file mode 100644
index 0000000..58db6b1
--- /dev/null
+++ b/.config/nvim/general/functions.vim
@@ -0,0 +1,9 @@
+" Turn spellcheck on for markdown files
+augroup auto_spellcheck
+ autocmd BufNewFile,BufRead *.md setlocal spell
+augroup END
+
+" Remove trailing whitespaces automatically before save
+" augroup strip_ws
+" autocmd BufWritePre * call utils#stripTrailingWhitespaces()
+" augroup END
diff --git a/.config/nvim/general/paths.vim b/.config/nvim/general/paths.vim
new file mode 100644
index 0000000..12ba27c
--- /dev/null
+++ b/.config/nvim/general/paths.vim
@@ -0,0 +1,4 @@
+let g:ruby_host_prog='rvm system do neovim-ruby-host'
+let g:python_host_prog='/usr/bin/python2'
+let g:python3_host_prog='/usr/bin/python3'
+
diff --git a/.config/nvim/general/settings.vim b/.config/nvim/general/settings.vim
new file mode 100644
index 0000000..f144a4c
--- /dev/null
+++ b/.config/nvim/general/settings.vim
@@ -0,0 +1,45 @@
+set iskeyword+=- " treat dash separated words as a word text object"
+set formatoptions-=cro " Stop newline continution of comments
+
+syntax enable " Enables syntax highlighing
+set hidden " Required to keep multiple buffers open multiple buffers
+set nowrap " Display long lines as just one line
+set encoding=utf-8 " The encoding displayed
+set pumheight=10 " Makes popup menu smaller
+set fileencoding=utf-8 " The encoding written to file
+set ruler " Show the cursor position all the time
+set cmdheight=2 " More space for displaying messages
+set splitbelow " Horizontal splits will automatically be below
+set splitright " Vertical splits will automatically be to the right
+set t_Co=256 " Support 256 colors
+set conceallevel=0 " So that I can see `` in markdown files
+set tabstop=2 " Insert 2 spaces for a tab
+set shiftwidth=2 " Change the number of space characters inserted for indentation
+set smarttab " Makes tabbing smarter will realize you have 2 vs 4
+set expandtab " Converts tabs to spaces
+set smartindent " Makes indenting smart
+set autoindent " Good auto indent
+set laststatus=2 " Always display the status line
+set number relativenumber " Line numbers
+set cursorline " Enable highlighting of the current line
+set background=dark " tell vim what the background color looks like
+set noshowmode " We don't need to see things like -- INSERT -- anymore
+set nobackup " This is recommended by coc
+set nowritebackup " This is recommended by coc
+set shortmess+=c " Don't pass messages to |ins-completion-menu|.
+set signcolumn=yes " Always show the signcolumn, otherwise it would shift the text each time
+set updatetime=300 " Faster completion
+set timeoutlen=100 " By default timeoutlen is 1000 ms
+set clipboard=unnamedplus " Copy paste between vim and everything else
+set incsearch
+
+colorscheme gruvbox
+
+" au! BufWritePost $MYVIMRC source % " auto source when writing to init.vm alternatively you can run :source $MYVIMRC
+autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
+
+
+"If you forget to sudo before calling vim use the following to be
+"able to write the file.
+cnoremap w!! %!sudo tee > /dev/null %
+
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim
index a56031e..97f2ec2 100755..100644
--- a/.config/nvim/init.vim
+++ b/.config/nvim/init.vim
@@ -1,718 +1,7 @@
-" ================================
-" NVimrc
-" ================================
-"
-" Plugin setup --- via vim-plug ----- {{{
-"
-filetype off
-"
-" set the runtime path to include Vundle and initialize
-"
-"set rtp+=$HOME/.config/nvim/bundle/Vundle.vim
-"
-" auto-install vim-plug
- 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
- "autocmd VimEnter * PlugInstall | source $MYVIMRC
- endif
+source $HOME/.config/nvim/vim-plug/plugins.vim
+source $HOME/.config/nvim/general/settings.vim
+source $HOME/.config/nvim/keys/mappings.vim
+"source $HOME/.config/nvim/themes/onedark.vim
+source $HOME/.config/nvim/themes/airline.vim
-call plug#begin('~/.config/nvim/plugged')
-"Plug 'alfredodeza/pytest.vim'
-Plug 'altercation/vim-colors-solarized'
-"Plug 'benmills/vimux'
-"Plug 'cburroughs/pep8.py'
-Plug 'chriskempson/tomorrow-theme'
-"Plug 'christoomey/vim-tmux-navigator'
-"Plug 'davidhalter/jedi-vim'
-"Plug 'ervandew/ag'
-"Plug 'ervandew/screen'
-"Plug 'ervandew/supertab'
-Plug 'flazz/vim-colorschemes'
-"Plug 'honza/vim-snippets'
-"Plug 'jistr/vim-nerdtree-tabs'
-Plug 'jnurmine/Zenburn'
-"Plug 'julienr/vim-cellmode'
-Plug 'junegunn/seoul256.vim'
-Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
-Plug 'junegunn/fzf.vim'
-"Plug 'klen/python-mode'
-Plug 'KabbAmine/zeavim.vim'
-"Plug 'kien/ctrlp.vim'
-"Plug 'majutsushi/tagbar'
-"Plug 'nelstrom/vim-markdown-preview'
-"Plug 'nvie/vim-flake8'
-"Plug 'pangloss/vim-javascript'
-"Plug 'Raimondi/delimitMate'
-"Plug 'rkulla/pydiction'
-Plug 'scrooloose/nerdtree'
-"Plug 'scrooloose/nerdcommenter'
-"Plug 'scrooloose/syntastic'
-Plug 'SirVer/ultisnips'
-"Plug 'sjl/tslime2.vim'
-"Plug 'suan/vim-instant-markdown'
-Plug 'tmhedberg/SimpylFold'
-"Plug 'tpope/timl'
-"Plug 'tpope/vim-fugitive'
-"Plug 'tpope/vim-markdown'
-"Plug 'tpope/vim-surround'
-"Plug 'Valloric/YouCompleteMe'
-Plug 'vim-airline/vim-airline'
-Plug 'vim-airline/vim-airline-themes'
-"Plug 'vim-latex/vim-latex'
-"Plug 'vim-scripts/indentpython.vim'
-"Plug 'vim-scripts/pydoc.vim'
-"Plug 'vim-scripts/vim-R-plugin'
-Plug 'vimwiki/vimwiki'
-"Plug 'wincent/command-t'
-"Plug 'WolfgangMehner/vim-plugins'
-"
-" All Plugins must be added before the following line
-"
-call plug#end() " required
-"
-"
-filetype on
-"
-" }}}
-"
-" =================================
-"
-"" GUI Settings ---------------------- {{{
-""
- "" GVIM- (here instead of .gvimrc)
- "if has('gui_running')
- "set lines=40
- "colorscheme zenburn
- "if has("gui_gtk2")
- "set guifont=Inconsolata\ 15
- "elseif has("gui_macvim")
- "set guifont=Inconsolata-dz:h14
- "endif
-
- "set guicursor=n-v-c:block-Cursor
- "else
- "set background=dark
- "set t_Co=256
- "colorscheme wombat256i
-
- "endif
-
-""
-"" }}}
-""
-"" =================================
-""
- "General Settings ------ {{{
-""
-
-let mapleader=","
-let maplocalleader=" "
-
-set autowrite
-set columns=100
-set dictionary+=/usr/share/dict/words
-set foldlevel=0 "0=all folds closed; 99=all folds open
-set foldmethod=marker
-"set g:python3_host_prog=/usr/bin/python3
-"set g:python2_host_prog=/usr/bin/python2
-set hidden
-"set lines=40
-set nobackup
-set nowritebackup
-set number
-set omnifunc=syntaxcomplete#Complete
-set shiftwidth=4
-set showmatch
-set showmode
-set title
-""set t_RV= "surpress terminal version query from vim
-"set visualbell
-set wildmode=list,longest,full
-""
-"" }}}
-""
-"" =================================
-""
-"" General Key Bindings ----- {{{
-""
-
-"noremap <C-F11> :NERDTreeToggle <CR>
-"nnoremap <leader>n :NERDTreeToggle <CR>
-
-"noremap <C-M> :make %<CR>
-"noremap <C-F5> :setlocal spell! spelllang = en_gb<CR>
-
-"noremap <C-\> :tab split <CR>exec("tag ".expand("<cword>"))<CR>
-"noremap <A-]> :vsp <CR>exec("tag ".expand("<cword>"))<CR>
-
-"nnoremap <leader>a :Ag<CR>
-
-"noremap <C-F3> <ESC>:set guifont=*<CR>
-"nnoremap <leader>f :set guifont=Monospace\ 12<CR>
-"nnoremap <leader>F :set guifont=Monospace\ 15<CR>
-"nnoremap <leader>[ :tabprevious<CR>
-"nnoremap <leader>] :tabnext<CR>
-
-"" clears highlighted search results
-"nnoremap <Esc> :nohlsearch <CR><Esc>
-
-""cd to current working directory
-"nnoremap <leader>cd :cd %:p:h<CR>:pwd<CR>
-
-"" edit vimrc file
-"nnoremap <leader>v :edit $MYVIMRC<CR>
-""
-""If you forget to sudo before calling vim use the following to be
-""able to write the file.
-"cnoremap w!! %!sudo tee > /dev/null %
-
-""open with @locate or find command
-""tutorial video: https://www.youtube.com/watch?v=X0KP15O006M
-"noremap <leader>o :exec '!xdg-open ' . shellescape(getline('.')) <CR><CR>
-"noremap <leader>mp :exec '!mplayer ' . shellescape(getline('.')) <CR><CR>
-"noremap <leader>yp :exec '!mplayer $(youtube-dl -g ' . shellescape(getline('.')) . ')' <CR><CR>
-
-""See docstrings for folded code
-"let g:SimpylFold_docstring_preview=1
-
-""Toggle relative numbering, and set to absolute on loss of focus or insert
-""mode
-
-"set rnu
-"function! ToggleNumbersOn()
- "set nonumber!
- "set norelativenumber!
-"endfunction
-"function! ToggleAbsoluteOn()
- "set nu!
- "set rnu
-"endfunction
-"function! ToggleRelativeOn()
- "set rnu!
- "set nu
-"endfunction
-"autocmd FocusGained * call ToggleRelativeOn()
-"autocmd FocusLost * call ToggleRelativeOn()
-"autocmd InsertLeave * call ToggleRelativeOn()
-"autocmd InsertEnter * call ToggleRelativeOn()
-"nmap <Leader>l :call ToggleNumbersOn()<CR>
-
-"""" SYSTEM CLIPBOARD COPY AND PASTE SUPPORT """
-"set pastetoggle=<F2> "F2 before pasting to preserve indentation
-""copy/paste to/from clipboard
-"vnoremap <C-c> "*y
-"map <silent><Leader>p :set paste<CR>o<Esc>"*]p:set nopaste<CR>"
-"map <silent><Leader><S-p> :set paste<CR>O<Esc>"*]p:set nopaste<CR>"
-
-""
-"" =================================
-""
-"" Ranger File Browser in Vim ----- {{{
-"" http://www.everythingcli.org/use-ranger-as-a-file-explorer-in-vim/
-"function! g:RangerExplorer()
- "exec "silent !ranger --choosefile=/tmp/vim_ranger_current_file " .
- "expand("%:p:h")
- "if filereadable('/tmp/vim_ranger_current_file')
- "exec 'edit ' . system('cat /tmp/vim_ranger_current_file')
- "call system('rm /tmp/vim_ranger_current_file')
- "endif
- "redraw!
-"endfunction
-"noremap <Leader>re :call g:RangerExplorer()<CR>
-"" }}}
-""
-""
-"" =================================
-
-""
-""Manage multiple windows
-""nnoremap <leader>W :call g:VGGToggleWindowFixedWidth()<CR>
-""nnoremap <leader>H :call g:VGGToggleWindowFixedHeight()<CR>
-"nnoremap <leader>W :call g:VGGAutoWindowResize()<CR>
-"" }}}
-""
-"" =================================
-""
-"" Eclim Settings ------ {{{
-""
-"" =================================
-""
-
-"" Status line setting
-"let g:EclimProjectStatusLine = 'eclim(p=${name}, n=${natures})'
-
-"let g:EclimProjectTreeAutoOpen=1
-"let g:EclimLocateFileNonProjectScope = 'ag'
-
-""
-"" }}}
-""
-"" =================================
-""
-"" Status Line ----- {{{
-""
-"function! Local_AirlineThemePatcher(palette)
- "" Trick to ensure 'Normal' highlight group exists
- "if !hlexists('Normal')
- "highlight Normal ctermbg=0
- "endif
-"endfunction
-
-"let g:airline_theme='luna'
-
-"if !exists('g:airline_symbols')
- "let g:airline_symbols = {}
-"endif
-
-"let g:airline_powerline_fonts = 1
-"let g:airline_left_sep = ''
-"let g:airline_left_alt_sep = ''
-"let g:airline_right_sep = ''
-"let g:airline_right_alt_sep = ''
-"let g:airline_symbols.branch = ''
-"let g:airline_symbols.readonly = ''
-"let g:airline_symbols.linenr = ''
-"let g:airline#extensions#tabline#enabled = 1
-"let g:airline#extensions#whitespace#enabled = 0
-
-"set timeoutlen=300 ttimeoutlen=0
-"set laststatus=2 "Always display status line
-"set statusline=%F "Full path to the file
-"set statusline+=\ -\ "Separator
-"set statusline+=%-4{fugitive#statusline()} "If using git, show
- ""branch being used
- ""in status line.
-"set statusline+=%-4{eclim#project#util#ProjectStatusLine()} " If using
- "" eclim, show project
- "" status line
-"set statusline+=%= "Switch to the right side
-"set statusline+=%l "Current line
-"set statusline+=/ " Separator
-"set statusline+=%L "Total lines
-
-""
-"" }}}
-""
-"" =================================
-""
-"" Vimscript file settings ------------ {{{
-""
-"augroup filetype_vim
- "autocmd!
- "autocmd FileType vim setlocal foldmethod=marker
- "" Source the vimrc file after saving it
- "if has("autocmd")
- "autocmd! bufwritepost $MYVIMRC nested :source $MYVIMRC
- "endif
- "function! g:VGGToggleWindowFixedWidth()
- ":set winfixwidth!
- "if &l:winfixwidth
- "echo "Fixed Window Width ON"
- "else
- "echo "Fixed Window Width OFF"
- "endif
- "endfunction
- "function! g:VGGToggleWindowFixedHeight()
- ":set winfixheight!
- "if &l:winfixheight
- "echo "Fixed Window Height ON"
- "else
- "echo "Fixed Window Height OFF"
- "endif
- "endfunction
- "function! g:VGGAutoWindowResize()
- "if winwidth == 100 || winheight == 40
- "set nowinfixwidth nowinfixheight
- "set noequalalways eadirection=both
- "set winminwidth=1 winminheight=1
- "set winwidth=9999 winheight=999
- "set helpheight=999 cmdwinheight=999 previewheight=999
- "echo "Window Defaults ON"
- "else
- "set nowinfixwidth nowinfixheight
- "set equalalways eadirection=both
- "set winminwidth=1 winminheight=0
- "set winwidth=100 winheight=40
- "set helpheight=20 cmdwinheight=7 previewheight=12
- "echo "Window Defaults OFF"
- "endif
- "endfunction
-"augroup END
-""
-"" }}}
-""
-"" =================================
-""
-"" Javascript file settings ------------ {{{
-""
-"augroup filetype_js
- "autocmd!
- "autocmd FileType javascript setlocal foldmethod=marker omnifunc=javascriptcomplete#CompleteJS
-"augroup END
-""
-"" }}}
-""
-"" =================================
-""
-"" Omnicompletion and SuperTab settings ------- {{{
-""
-"inoremap <expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>"
-"inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
-"inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
-"inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
-"inoremap <expr> <PageDown> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<PageDown>"
-"inoremap <expr> <PageUp> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<PageUp>"
-
-"let g:SuperTabDefaultCompletionType="context"
-
-""YouCompleteMe
-"let g:ycm_autoclose_preview_window_after_completion=1
-"noremap <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
-
-""
-"" Automatically open and close the popup menu / preview window
-""
-
-"au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
-"set completeopt=menuone,menu,longest,preview
-
-""
-"" }}}
-""
-"" =================================
-""
-"" Taglist Settings ---- {{{
-""
-"" Taglist variables
-""
-"set tags+=./tags;/
-"set tags+=$HOME/Computing/Sandbox/tags
-""
-""can verify taglist is correct via
-"": set verbose tags?" command
-
-""
-"" Display function name in status bar:
-""
-"let g:ctags_statusline=1
-""
-"" Automatically start script
-""
-"let generate_tags=1
-""
-"" Displays taglist results in a vertical window:
-""
-"let Tlist_Use_Horiz_Window=0
-""
-"" Shorter commands to toggle Taglist display
-""
-"nnoremap TT :TlistToggle<CR>
-"nnoremap <C-S-F11> :TlistToggle<CR>
-"noremap <C-S-F12> :call g:VGGCTagsGenerate()<CR>
-
-"function! g:VGGCTagsGenerate()
- ":!ctags -R --c++-kinds=+pl --fields=+iaS --extra=+q .
- ":!ctags -R --c-kinds=+pl --fields=+iaS --extra=+q .
- ":!ctags -R --Fortran-kinds=+iL --fields=+iaS --extra=+q .
- ":!ctags -R --Python-kinds=+cfimv --fields=+iaS --extra=+q .
- ":!ctags -R --Vim-kinds=+acfmv --fields=+iaS --extra=+q .
- "echo "cTags generated..."
-"endfunction
-""
-"" Various Taglist diplay config:
-""
-"let Tlist_Use_Left_Window=1
-"let Tlist_Compact_Format=1
-"let Tlist_Exit_OnlyWindow=1
-"let Tlist_GainFocus_On_ToggleOpen=1
-"let Tlist_File_Fold_Auto_Close=1
-"let Tlist_WinWidth=20
-
-""
-"" }}}
-""
-"" =================================
-""
-""Tagbar Settings ---- {{{
-""
-""Toggle Tagbar window
-"let g:tagbar_width=20
-"let g:tagbar_zoomwidth=0
-"nnoremap <F7> :TagbarToggle<CR>
-""
-"" }}}
-""
-"" =================================
-""
-""Some Python settings:------------------- {{{
-
-"augroup filetype_py
- "" Clears the group each time vimrc is sourced
- "" to prevent multiple definitions of the same autocmd
- ""
- "autocmd!
- ""
- "autocmd FileType python set omnifunc=pythoncomplete#Complete
- "autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
- "autocmd BufRead, BufNewFile *.py
- "\ set tabstop=4
- "\ set softtabstop=4
- "\ set shiftwidth=4
- "\ set textwidth=79
- "\ set expandtab
- "\ set autoindent
- "\ set fileformat=unix
-
- ""
- "" This will allow you to check the syntax of your entire file
- "" by typing :make. You can the get a list of errors with :clist
- "" and move between the errors with :cn and :cp.
- ""
- "autocmd BufRead *.py set makeprg=python\ -c\ \"import\ py_compile,sys;\ sys.stderr=sys.stdout;\ py_compile.compile(r'%')\"
- "autocmd Bufwrite *.(py) : call Pyflakes()
- "autocmd BufRead *.py set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m
-
- "" Execute pydoc on the current word in the file being edited
-"" autocmd FileType python noremap <buffer> K : execute "!xterm -e 'pydoc " . expand("<cword>") . "'"<CR>
- "" Execute file being edited with <Command> + e:
-"" noremap <buffer> <C-e> :w\|!/usr/bin/env python % <CR>
-
-"let g:pydiction_location="~/.vim/bundle/pydiction/complete-dict"
-"let g:pyflakes_use_quickfix=0
-"let g:pep8_map="<leader>8"
-""
-"" For full syntax highlighting:
-""
-"let python_highlight_all=1
-"syntax on
-
-""
-""pymode
-""
-"let g:pymode_python = 'python3'
-""
-"" jedi-vim settings
-""
-
-"let g:jedi#goto_command = "<LocalLeader>d"
-"let g:jedi#use_splits_not_buffers = "right"
-"let g:jedi#goto_assignments_command = "<LocalLeader>G"
-"let g:jedi#goto_definitions_command = "<LocalLeader>GG"
-"let g:jedi#documentation_command = "K"
-"let g:jedi#usages_command = "<LocalLeader>n"
-"let g:jedi#completions_command = "<C-Space>"
-"let g:jedi#rename_command = "<LocalLeader>r"
-"let g:jedi#show_call_signatures = 2
-""
-""
-"" screen stuff
-""
-"let g:ScreenImpl = "Tmux"
-"let g:ScreenShellTmuxInitArgs = '-2'
-"let g:ScreenShellSendPrefix = ''
-"let g:ScreenShellSendSufix = ''
-
-
-"" Open an IPython3 shell.
-"autocmd FileType python map <LocalLeader>p :IPython!<CR>
-
-"" Close whichever shell is running.
-"autocmd FileType python map <LocalLeader>q :ScreenQuit<CR>
-
-"" Send current line to python and move to next line.
-"autocmd FileType python map <LocalLeader>v :ScreenSend<CR>0j
-
-"" Send a <CR> to ipython.
-"autocmd FileType python map <LocalLeader>cr :call g:ScreenShellSend("\r")<CR>
-
-"" Clear the screen.
-"autocmd FileType python map <LocalLeader>L :call g:ScreenShellSend('!clear')<CR>
-""
-"" Using tslime2 to send python code to ipython
-"" press vip to select current paragraph then press <C-c><C-c> and this sends
-"" the code to ipthon. This also works sending current line and any selected text
-""
-"" cellmode
-""
-"let g:cellmode_use_tmux=1
-"let g:cellmode_tmux_windowname=''
-"let g:cellmode_tmux_panenumber=2
-""
-"" Vimux
-""
-
-"function! VimuxSlime()
- "call VimuxSendText(@v)
- "call VimuxSendKeys("Enter")
-"endfunction
-
-""If text is selected save it in the v buffer and send that buffer to tmux
-""vmap <LocalLeader>k \"vy :call VimuxSlime()<CR>
-
-""Select current paragraph and send that it to tmux
-""nmap <LocalLeader>x vip<LocalLeader>vs<CR>
-"" Execute py tests
-""
-"nnoremap <silent><leader>ptf <Esc>:Pytest file<CR>
-"nnoremap <silent><leader>ptc <Esc>:Pytest class<CR>
-"nnoremap <silent><leader>ptm <Esc>:Pytest method<CR>
-""
-"" Cycle through test errors
-""
-"nnoremap <silent><leader>ptn <Esc>:Pytest next<CR>
-"nnoremap <silent><leader>ptp <Esc>:Pytest previous<CR>
-"nnoremap <silent><leader>pte <Esc>:Pytest error<CR>
-
-"augroup END
-
-""
-"" }}}
-""
-"" =================================
-""
-"" Latex Settings ----- {{{
-""
-"" IMPORTANT: grep will sometimes skip displaying the file name if you
-"" search in a singe file. This will confuse Latex-Suite. Set your grep
-"" program to always generate a file-name.
-
-"set grepprg=grep\ -nH\ $*
-
-"" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files
-"" defaults to 'plaintex' instead of 'tex', which results in vim-latex
-"" not being loaded. The following changes the default filetype back
-"" to 'tex':
-
-"let g:tex_flavor='latex'
-""
-"" }}}
-""
-"" =================================
-""
-"" Man Pages Settings ----- {{{
-""
-"" Set up the reading of manpages from within vim (use :Man whatever)
-
-"au BufNewFile,BufRead *.js, *.html, *.css
- "\ set tabstop=2
- "\ set softtabstop=2
- "\ set shiftwidth=2
-
-""
-"" }}}
-""
-"" =================================
-""
-"" Ag Settings ----- {{{
-""
-"" ag.vim is a plugin for vim which allows you to search over files using the
-"" silver searcher (ag).
-""
-"" Usage
-""
-"" :Ag [options] pattern [directory]
-""
-"" The :Ag command provides several features to make running ag easier:
-""
-"" :Ag supports command completion of:
-""
-"" - patterns from search history: hit <tab> when starting
-"" to run :Ag and you can choose from a list of 10 of your most
-"" recent searches. A common use case while editing code could be to
-"" hit * on a function name to search for occurrences in the current
-"" file, then to run :Ag <tab> to search for the function across all
-"" files.
-"" - ag options: If you type - and then hit <tab>, you can
-"" scroll through all the ag.vim supported ag options.
-"" - file/directory name to search in: Once you've
-"" supplied a search pattern, the next argument to
-"" :Ag is an optional directory or file to search in
-"" and you can make use of <tab> completion to choose
-"" that file or directory.
-"" ag.vim also registers itself as a backend for eclim's :LocateFile functionality. You
-"" can even set ag as the default for non-eclim projects by adding the following to your vimrc:
-""
-"" let g:EclimLocateFileNonProjectScope = 'ag'
-
- "let g:AgSmartCase=1
-""
-"" }}}
-"" =================================
-""
-"" Vim Wiki Settings ----- {{{
-""
-"" vimwiki - Personal wiki for vim
-"" https://github.com/vikiwiki/vimwik
-
-"" vimwiki with markdown support
-
-"let g:vimwiki_list = [{'path': '$HOME/vimwiki',
- "\ 'syntax': 'markdown',
- "\ 'ext': '.md'}]
-
-"" help-page -> :h vimwiki-syntax
-
-""vim-instant-markdown - Instant markdown previews from vim
-"" https://github.com/suan/vim-instant-markdown
-
-"let g:instant_markdown_autostart = 0 " disable autostart
-"noremap <LocalLeader>md :InstantMarkdownPreview<CR>
-
-""
-"" }}}
-""
-"" =================================
-""
-"" FZF Settings ----- {{{
-""
-"function! FzfOmniOmniFiles()
- "let is_git = system('git status')
- "if v:shell_error
- ":Files
- "else
- ":GitFiles
- "endif
-"endfunction
-"nnoremap <C-P> : call FzfOmniOmniFiles()<CR>
-
-"let g:fzf_files_options =
- "\ '--preview "(coderay {} || cat {}) 2> /dev/null | head - '.&lines.'"'
-
-""
-"" }}}
-""
-"" =================================
-""
-"" UltiSnips Settings ----- {{{
-""
-"" Trigger configuration. Do not use <tab> if you use
-"" https://github.com/Valloric/YouCompleteMe.
-
-"let g:UltiSnipsExpandTrigger="<LocalLeader>s"
-"let g:UltiSnipsJumpForwardTrigger="<C-S-b>"
-"let g:UltiSnipsJumpBackwardTrigger="<C-S-z>"
-
-"" If you want :UltiSnipsEdit to split your window.
-"let g:UltiSnipsEditSplit="vertical"
-
-""
-"" }}}
-""
-"" =================================
-""
-"" CtrlP Settings ----- {{{
-""
-"let g:ctrlp_map = '<c-p>'
-""
-"" }}}
-""
-"" =================================
-""
-"" =================================
-""
-runtime ftplugin/man.vim
-""
- "=================================
diff --git a/.config/nvim/keys/mappings.vim b/.config/nvim/keys/mappings.vim
new file mode 100644
index 0000000..929414b
--- /dev/null
+++ b/.config/nvim/keys/mappings.vim
@@ -0,0 +1,73 @@
+" g Leader key
+let mapleader=","
+let localleader=",,"
+nnoremap <Space> <Nop>
+map <leader>v :edit $MYVIMRC<CR>
+
+" Better indenting
+vnoremap < <gv
+vnoremap > >gv
+
+" Better nav for omnicomplete
+inoremap <expr> <c-j> ("\<C-n>")
+inoremap <expr> <c-k> ("\<C-p>")
+
+" TAB in general mode will move to text buffer
+nnoremap <silent> <TAB> :bnext<CR>
+" SHIFT-TAB will go back
+nnoremap <silent> <S-TAB> :bprevious<CR>
+
+" Use control-c instead of escape
+nnoremap <silent> <C-c> <Esc>
+" <TAB>: completion.
+inoremap <silent> <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
+
+" Better window navigation
+nnoremap <C-h> <C-w>h
+nnoremap <C-j> <C-w>j
+nnoremap <C-k> <C-w>k
+nnoremap <C-l> <C-w>l
+
+" Use alt + hjkl to resize windows
+nnoremap <silent> <M-j> :resize -2<CR>
+nnoremap <silent> <M-k> :resize +2<CR>
+nnoremap <silent> <M-h> :vertical resize -2<CR>
+nnoremap <silent> <M-l> :vertical resize +2<CR>
+
+" Copy selected text to system clipboard (requires gvim/nvim/vim-x11 installed):
+vnoremap <C-c> "+y
+map <C-p> "+P
+
+" Binary File Settings ---- {{{
+"
+" Hex read
+nmap <leader>hr :%!xxd<CR> :set filetype=xxd<CR>
+" Hex write
+nmap <leader>hw :%!xxd -r<CR> :set binary<CR> :set filetype=xxd<CR>
+"
+" }}}
+" Info Pages Settings ----- {{{
+"
+" Set up the reading of info from within vim (use :Info whatever)
+
+nnoremap <F1> :exe ":Info ".expand("<cword>")<CR>
+
+"
+" }}}
+" Terminal Emulator ----- {{{
+"
+"
+tnoremap <Esc> <C-\><C-n>
+
+" Usel alt+hjkl to move between windows
+
+tnoremap <A-h> <C-\><C-n><C-w>h
+tnoremap <A-j> <C-\><C-n><C-w>j
+tnoremap <A-k> <C-\><C-n><C-w>k
+tnoremap <A-l> <C-\><C-n><C-w>l
+nnoremap <A-h> <C-w>h
+nnoremap <A-j> <C-w>j
+nnoremap <A-k> <C-w>k
+nnoremap <A-l> <C-w>l
+"
+" }}}
diff --git a/.config/nvim/keys/which-key.vim b/.config/nvim/keys/which-key.vim
new file mode 100644
index 0000000..87eda18
--- /dev/null
+++ b/.config/nvim/keys/which-key.vim
@@ -0,0 +1,170 @@
+" Map leader to which_key
+nnoremap <silent> <leader> :silent WhichKey '<Space>'<CR>
+vnoremap <silent> <leader> :silent <c-u> :silent WhichKeyVisual '<Space>'<CR>
+
+" Create map to add keys to
+let g:which_key_map = {}
+" Define a separator
+let g:which_key_sep = '→'
+" set timeoutlen=100
+
+
+" Not a fan of floating windows for this
+let g:which_key_use_floating_win = 0
+
+" Change the colors if you want
+highlight default link WhichKey Operator
+highlight default link WhichKeySeperator DiffAdded
+highlight default link WhichKeyGroup Identifier
+highlight default link WhichKeyDesc Function
+
+" Hide status line
+autocmd! FileType which_key
+autocmd FileType which_key set laststatus=0 noshowmode noruler
+ \| autocmd BufLeave <buffer> set laststatus=2 noshowmode ruler
+
+" Single mappings
+let g:which_key_map['/'] = [ '<Plug>NERDCommenterToggle' , 'comment' ]
+let g:which_key_map['.'] = [ ':e $MYVIMRC' , 'open init' ]
+let g:which_key_map[';'] = [ ':Commands' , 'commands' ]
+let g:which_key_map['='] = [ '<C-W>=' , 'balance windows' ]
+let g:which_key_map[','] = [ 'Startify' , 'start screen' ]
+let g:which_key_map['d'] = [ ':bd' , 'delete buffer']
+let g:which_key_map['e'] = [ ':CocCommand explorer' , 'explorer' ]
+let g:which_key_map['f'] = [ ':Files' , 'search files' ]
+let g:which_key_map['h'] = [ '<C-W>s' , 'split below']
+let g:which_key_map['q'] = [ 'q' , 'quit' ]
+let g:which_key_map['r'] = [ ':RnvimrToggle' , 'ranger' ]
+let g:which_key_map['S'] = [ ':SSave' , 'save session' ]
+let g:which_key_map['T'] = [ ':Rg' , 'search text' ]
+let g:which_key_map['v'] = [ '<C-W>v' , 'split right']
+let g:which_key_map['w'] = [ 'w' , 'write' ]
+let g:which_key_map['z'] = [ 'Goyo' , 'zen' ]
+
+" Group mappings
+
+" b is for buffer
+let g:which_key_map.b = {
+ \ 'name' : '+buffer' ,
+ \ '1' : ['b1' , 'buffer 1'] ,
+ \ '2' : ['b2' , 'buffer 2'] ,
+ \ 'd' : ['bd' , 'delete-buffer'] ,
+ \ 'f' : ['bfirst' , 'first-buffer'] ,
+ \ 'h' : ['Startify' , 'home-buffer'] ,
+ \ 'l' : ['blast' , 'last-buffer'] ,
+ \ 'n' : ['bnext' , 'next-buffer'] ,
+ \ 'p' : ['bprevious' , 'previous-buffer'] ,
+ \ '?' : ['Buffers' , 'fzf-buffer'] ,
+ \ }
+
+" s is for search
+let g:which_key_map.s = {
+ \ 'name' : '+search' ,
+ \ '/' : [':History/' , 'history'],
+ \ ';' : [':Commands' , 'commands'],
+ \ 'a' : [':Ag' , 'text Ag'],
+ \ 'b' : [':BLines' , 'current buffer'],
+ \ 'B' : [':Buffers' , 'open buffers'],
+ \ 'c' : [':Commits' , 'commits'],
+ \ 'C' : [':BCommits' , 'buffer commits'],
+ \ 'f' : [':Files' , 'files'],
+ \ 'g' : [':GFiles' , 'git files'],
+ \ 'G' : [':GFiles?' , 'modified git files'],
+ \ 'h' : [':History' , 'file history'],
+ \ 'H' : [':History:' , 'command history'],
+ \ 'l' : [':Lines' , 'lines'] ,
+ \ 'm' : [':Marks' , 'marks'] ,
+ \ 'M' : [':Maps' , 'normal maps'] ,
+ \ 'p' : [':Helptags' , 'help tags'] ,
+ \ 'P' : [':Tags' , 'project tags'],
+ \ 's' : [':Snippets' , 'snippets'],
+ \ 'S' : [':Colors' , 'color schemes'],
+ \ 't' : [':Rg' , 'text Rg'],
+ \ 'T' : [':BTags' , 'buffer tags'],
+ \ 'w' : [':Windows' , 'search windows'],
+ \ 'y' : [':Filetypes' , 'file types'],
+ \ 'z' : [':FZF' , 'FZF'],
+ \ }
+
+" g is for git
+let g:which_key_map.g = {
+ \ 'name' : '+git' ,
+ \ 'a' : [':Git add .' , 'add all'],
+ \ 'A' : [':Git add %' , 'add current'],
+ \ 'b' : [':Git blame' , 'blame'],
+ \ 'B' : [':GBrowse' , 'browse'],
+ \ 'c' : [':Git commit -m "autocommit"' , 'commit'],
+ \ 'd' : [':Git diff' , 'diff'],
+ \ 'D' : [':Gdiffsplit' , 'diff split'],
+ \ 'g' : [':GGrep' , 'git grep'],
+ \ 'G' : [':Gstatus' , 'status'],
+ \ 'h' : [':GitGutterLineHighlightsToggle' , 'highlight hunks'],
+ \ 'H' : ['<Plug>(GitGutterPreviewHunk)' , 'preview hunk'],
+ \ 'j' : ['<Plug>(GitGutterNextHunk)' , 'next hunk'],
+ \ 'k' : ['<Plug>(GitGutterPrevHunk)' , 'prev hunk'],
+ \ 'l' : [':Git log' , 'log'],
+ \ 'p' : [':Git push' , 'push'],
+ \ 'P' : [':Git pull' , 'pull'],
+ \ 'r' : [':GRemove' , 'remove'],
+ \ 's' : ['<Plug>(GitGutterStageHunk)' , 'stage hunk'],
+ \ 't' : [':GitGutterSignsToggle' , 'toggle signs'],
+ \ 'u' : ['<Plug>(GitGutterUndoHunk)' , 'undo hunk'],
+ \ 'v' : [':GV' , 'view commits'],
+ \ 'V' : [':GV!' , 'view buffer commits'],
+ \ }
+
+" l is for language server protocol
+let g:which_key_map.l = {
+ \ 'name' : '+lsp' ,
+ \ '.' : [':CocConfig' , 'config'],
+ \ ';' : ['<Plug>(coc-refactor)' , 'refactor'],
+ \ 'a' : ['<Plug>(coc-codeaction)' , 'line action'],
+ \ 'A' : ['<Plug>(coc-codeaction-selected)' , 'selected action'],
+ \ 'b' : [':CocNext' , 'next action'],
+ \ 'B' : [':CocPrev' , 'prev action'],
+ \ 'c' : [':CocList commands' , 'commands'],
+ \ 'd' : ['<Plug>(coc-definition)' , 'definition'],
+ \ 'D' : ['<Plug>(coc-declaration)' , 'declaration'],
+ \ 'e' : [':CocList extensions' , 'extensions'],
+ \ 'f' : ['<Plug>(coc-format-selected)' , 'format selected'],
+ \ 'F' : ['<Plug>(coc-format)' , 'format'],
+ \ 'h' : ['<Plug>(coc-float-hide)' , 'hide'],
+ \ 'i' : ['<Plug>(coc-implementation)' , 'implementation'],
+ \ 'I' : [':CocList diagnostics' , 'diagnostics'],
+ \ 'j' : ['<Plug>(coc-float-jump)' , 'float jump'],
+ \ 'l' : ['<Plug>(coc-codelens-action)' , 'code lens'],
+ \ 'n' : ['<Plug>(coc-diagnostic-next)' , 'next diagnostic'],
+ \ 'N' : ['<Plug>(coc-diagnostic-next-error)' , 'next error'],
+ \ 'o' : ['<Plug>(coc-openlink)' , 'open link'],
+ \ 'O' : [':CocList outline' , 'outline'],
+ \ 'p' : ['<Plug>(coc-diagnostic-prev)' , 'prev diagnostic'],
+ \ 'P' : ['<Plug>(coc-diagnostic-prev-error)' , 'prev error'],
+ \ 'q' : ['<Plug>(coc-fix-current)' , 'quickfix'],
+ \ 'r' : ['<Plug>(coc-rename)' , 'rename'],
+ \ 'R' : ['<Plug>(coc-references)' , 'references'],
+ \ 's' : [':CocList -I symbols' , 'references'],
+ \ 't' : ['<Plug>(coc-type-definition)' , 'type definition'],
+ \ 'u' : [':CocListResume' , 'resume list'],
+ \ 'U' : [':CocUpdate' , 'update CoC'],
+ \ 'v' : [':Vista!!' , 'tag viewer'],
+ \ 'z' : [':CocDisable' , 'disable CoC'],
+ \ 'Z' : [':CocEnable' , 'enable CoC'],
+ \ }
+
+
+" t is for toggle
+let g:which_key_map.t = {
+ \ 'name' : '+toggle' ,
+ \ 'c' : [':ColorizerToggle' , 'colorizer'],
+ \ 'e' : [':CocCommand explorer' , 'explorer'],
+ \ 'n' : [':set nonumber!' , 'line-numbers'],
+ \ 'r' : [':set norelativenumber!' , 'relative line nums'],
+ \ 's' : [':let @/ = ""' , 'remove search highlight'],
+ \ 't' : [':FloatermToggle' , 'terminal'],
+ \ 'v' : [':Vista!!' , 'tag viewer'],
+ \ }
+
+" Register which key map
+call which_key#register('<Space>', "g:which_key_map")
+
+
diff --git a/.config/nvim/plug-config/coc.vim b/.config/nvim/plug-config/coc.vim
new file mode 100644
index 0000000..709f971
--- /dev/null
+++ b/.config/nvim/plug-config/coc.vim
@@ -0,0 +1,157 @@
+ " let g:coc_global_extensions = [
+ " \ 'coc-snippets',
+ " \ 'coc-actions',
+ " \ 'coc-emmet',
+ " \ 'coc-pairs',
+ " \ 'coc-tsserver',
+ " \ 'coc-floaterm',
+ " \ 'coc-html',
+ " \ 'coc-css',
+ " \ 'coc-cssmodules',
+ " \ 'coc-yaml',
+ " \ 'coc-python',
+ " \ 'coc-explorer',
+ " \ 'coc-svg',
+ " \ 'coc-prettier',
+ " \ 'coc-vimlsp',
+ " \ 'coc-flutter',
+ " \ 'coc-xml',
+ " \ 'coc-yank',
+ " \ 'coc-json',
+ " \ 'coc-vimtex',
+ " \ ]
+
+" Use tab for trigger completion with characters ahead and navigate.
+inoremap <silent><expr> <TAB>
+ \ pumvisible() ? "\<C-n>" :
+ \ <SID>check_back_space() ? "\<TAB>" :
+ \ coc#refresh()
+inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
+
+function! s:check_back_space() abort
+ let col = col('.') - 1
+ return !col || getline('.')[col - 1] =~# '\s'
+endfunction
+
+" Use <c-space> to trigger completion.
+inoremap <silent><expr> <c-space> coc#refresh()
+
+" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current
+" position. Coc only does snippet and additional edit on confirm.
+if exists('*complete_info')
+ inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>"
+else
+ imap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
+endif
+
+" GoTo code navigation.
+nmap <silent> gd <Plug>(coc-definition)
+nmap <silent> gy <Plug>(coc-type-definition)
+nmap <silent> gi <Plug>(coc-implementation)
+nmap <silent> gr <Plug>(coc-references)
+
+" Use K to show documentation in preview window.
+nnoremap <silent> K :call <SID>show_documentation()<CR>
+
+function! s:show_documentation()
+ if (index(['vim','help'], &filetype) >= 0)
+ execute 'h '.expand('<cword>')
+ else
+ call CocAction('doHover')
+ endif
+endfunction
+
+" Highlight the symbol and its references when holding the cursor.
+autocmd CursorHold * silent call CocActionAsync('highlight')
+
+" Symbol renaming.
+" nmap <leader>rn <Plug>(coc-rename)
+
+augroup mygroup
+ autocmd!
+ " Setup formatexpr specified filetype(s).
+ autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
+ " Update signature help on jump placeholder.
+ autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
+augroup end
+
+" Applying codeAction to the selected region.
+" Example: `<leader>aap` for current paragraph
+" xmap <leader>a <Plug>(coc-codeaction-selected)
+" nmap <leader>a <Plug>(coc-codeaction-selected)
+
+" Remap keys for applying codeAction to the current line.
+" nmap <leader>ac <Plug>(coc-codeaction)
+" Apply AutoFix to problem on the current line.
+" nmap <leader>qf <Plug>(coc-fix-current)
+
+" Introduce function text object
+" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
+xmap if <Plug>(coc-funcobj-i)
+xmap af <Plug>(coc-funcobj-a)
+omap if <Plug>(coc-funcobj-i)
+omap af <Plug>(coc-funcobj-a)
+
+" Use <TAB> for selections ranges.
+" NOTE: Requires 'textDocument/selectionRange' support from the language server.
+" coc-tsserver, coc-python are the examples of servers that support it.
+" nmap <silent> <TAB> <Plug>(coc-range-select)
+" xmap <silent> <TAB> <Plug>(coc-range-select)
+
+" Add `:Format` command to format current buffer.
+command! -nargs=0 Format :call CocAction('format')
+
+" Add `:Fold` command to fold current buffer.
+command! -nargs=? Fold :call CocAction('fold', <f-args>)
+
+" Add `:OR` command for organize imports of the current buffer.
+command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
+
+" Add (Neo)Vim's native statusline support.
+" NOTE: Please see `:h coc-status` for integrations with external plugins that
+" provide custom statusline: lightline.vim, vim-airline.
+set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
+
+" Mappings using CoCList:
+" Show all diagnostics.
+" TODO add these to which key
+" nnoremap <silent> <space>a :<C-u>CocList diagnostics<cr>
+" " Manage extensions.
+" nnoremap <silent> <space>e :<C-u>CocList extensions<cr>
+" " Show commands.
+" nnoremap <silent> <space>c :<C-u>CocList commands<cr>
+" " Find symbol of current document.
+" nnoremap <silent> <space>o :<C-u>CocList outline<cr>
+" " Search workspace symbols.
+" nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr>
+" " Do default action for next item.
+" nnoremap <silent> <space>j :<C-u>CocNext<CR>
+" " Do default action for previous item.
+" nnoremap <silent> <space>k :<C-u>CocPrev<CR>
+" " Resume latest coc list.
+" nnoremap <silent> <space>p :<C-u>CocListResume<CR>
+
+" Explorer
+let g:coc_explorer_global_presets = {
+\ 'floating': {
+\ 'position': 'floating',
+\ },
+\ 'floatingLeftside': {
+\ 'position': 'floating',
+\ 'floating-position': 'left-center',
+\ 'floating-width': 30,
+\ },
+\ 'floatingRightside': {
+\ 'position': 'floating',
+\ 'floating-position': 'right-center',
+\ 'floating-width': 30,
+\ },
+\ 'simplify': {
+\ 'file.child.template': '[selection | clip | 1] [indent][icon | 1] [filename omitCenter 1]'
+\ }
+\ }
+"nmap <silent> <space>e :CocCommand explorer<CR>
+" nnoremap <silent> <leader>e :CocCommand explorer<CR>
+" nmap <space>f :CocCommand explorer --preset floatingRightside<CR>
+autocmd BufEnter * if (winnr("$") == 1 && &filetype == 'coc-explorer') | q | endif
+
diff --git a/.config/nvim/themes/airline.vim b/.config/nvim/themes/airline.vim
new file mode 100644
index 0000000..991398e
--- /dev/null
+++ b/.config/nvim/themes/airline.vim
@@ -0,0 +1,34 @@
+"let g:airline_theme='luna'
+let g:airline_theme='onedark'
+
+if !exists('g:airline_symbols')
+ let g:airline_symbols = {}
+endif
+
+let g:airline_powerline_fonts = 1
+ " unicode symbols
+let g:airline_left_sep = '▶'
+let g:airline_right_sep = '◀'
+let g:airline_symbols.crypt = '🔒'
+let g:airline_symbols.linenr = '☰'
+let g:airline_symbols.maxlinenr = '㏑'
+let g:airline_symbols.branch = '⎇'
+let g:airline_symbols.paste = 'Þ'
+let g:airline_symbols.spell = 'Ꞩ'
+let g:airline_symbols.notexists = 'Ɇ'
+let g:airline_symbols.whitespace = 'Ξ'
+let g:powerline_pycmd='py3'
+
+" enable tabline
+let g:airline#extensions#tabline#enabled = 1
+let g:airline#extensions#tabline#left_sep = '▶'
+let g:airline#extensions#tabline#right_sep = '◀'
+
+"set showtabline 1
+
+set timeoutlen=300 ttimeoutlen=0
+set laststatus=2 " always display the status line
+set statusline=%F "Full path to the file
+set statusline+=\ -\ "Separator
+set statusline+=%-4{fugitive#statusline()} "If using git, show branch being used
+
diff --git a/.config/nvim/themes/onedark.vim b/.config/nvim/themes/onedark.vim
new file mode 100644
index 0000000..9b9cfea
--- /dev/null
+++ b/.config/nvim/themes/onedark.vim
@@ -0,0 +1,23 @@
+" onedark.vim override: Don't set a background color when running in a terminal;
+"if (has("autocmd") && !has("gui_running"))
+ "augroup colorset
+ "autocmd!
+ "let s:white = { "gui": "#ABB2BF", "cterm": "145", "cterm16" : "7" }
+ "autocmd ColorScheme * call onedark#set_highlight("Normal", { "fg": s:white }) " `bg` will not be styled since there is no `bg` setting
+ "augroup END
+"endif
+
+hi Comment cterm=italic
+let g:onedark_hide_endofbuffer=1
+let g:onedark_terminal_italics=1
+let g:onedark_termcolors=256
+
+syntax on
+colorscheme onedark
+
+
+" checks if your terminal has 24-bit color support
+if (has("termguicolors"))
+ set termguicolors
+ hi LineNr ctermbg=NONE guibg=NONE
+endif
diff --git a/.config/nvim/vim-plug/plugins.vim b/.config/nvim/vim-plug/plugins.vim
new file mode 100644
index 0000000..e5cb1a6
--- /dev/null
+++ b/.config/nvim/vim-plug/plugins.vim
@@ -0,0 +1,49 @@
+" auto-install vim-plug
+
+if ! filereadable(expand('~/.config/nvim/autoload/plug.vim'))
+ echo "Downloading junegunn/vim-plug to manage plugins..."
+ silent !mkdir -p ~/.config/nvim/autoload/
+ silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ~/.config/nvim/autoload/plug.vim
+endif
+
+call plug#begin('~/.config/nvim/plugged')
+"Plug 'alok/notational-fzf-vim'
+Plug 'dbeniamine/cheat.sh-vim'
+Plug 'dbeniamine/vim-mail'
+Plug 'honza/vim-snippets'
+Plug 'jalvesaq/Nvim-R'
+Plug 'jalvesaq/vimcmdline'
+Plug 'jceb/vim-orgmode'
+Plug 'jnurmine/Zenburn'
+Plug 'joshdick/onedark.vim'
+Plug 'junegunn/fzf.vim'
+Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
+Plug 'junegunn/goyo.vim'
+Plug 'junegunn/Limelight.vim'
+Plug 'liuchengxu/vim-which-key' " See what keys do like in emacs
+Plug 'morhetz/gruvbox'
+Plug 'nelstrom/vim-markdown-preview'
+Plug 'neoclide/coc.nvim', {'branch': 'release'}
+Plug 'pangloss/vim-javascript'
+Plug 'PotatoesMaster/i3-vim-syntax'
+Plug 'scrooloose/nerdtree'
+Plug 'scrooloose/nerdcommenter' " Comment stuff out
+Plug 'sheerun/vim-polyglot'
+Plug 'SirVer/ultisnips'
+Plug 'suan/vim-instant-markdown', {'for': 'markdown'}
+Plug 'szymonmaszke/vimpyter'
+Plug 'terryma/vim-multiple-cursors'
+Plug 'tmhedberg/SimpylFold'
+Plug 'tpope/timl'
+Plug 'tpope/vim-markdown'
+Plug 'tpope/vim-surround'
+Plug 'tpope/vim-fugitive'
+Plug 'vim-airline/vim-airline'
+Plug 'vim-airline/vim-airline-themes'
+Plug 'vim-latex/vim-latex'
+Plug 'vifm/vifm.vim'
+Plug 'vimwiki/vimwiki'
+Plug 'voldikss/vim-floaterm'
+Plug 'xuhdev/vim-latex-live-preview'
+call plug#end()
+