Skip to content

Instantly share code, notes, and snippets.

@dhollinger
Last active February 4, 2020 19:25
Show Gist options
  • Save dhollinger/c46139cd3e8f2f449c8364e4bc27f58e to your computer and use it in GitHub Desktop.
Save dhollinger/c46139cd3e8f2f449c8364e4bc27f58e to your computer and use it in GitHub Desktop.
Neovim Settings
{
"languageserver": {
"puppet": {
"command": "ruby",
"args": ["/home/dhollinger/workspace/ruby/puppet-editor-services/puppet-languageserver","--stdio","--puppet-settings=--moduledir,/home/dhollinger/.puppetlabs/etc/code/modules"],
"cwd": "/home/dhollinger/workspace/ruby/puppet-editor-services",
"filetypes": ["puppet"],
"rootPatterns": [".git/", "metadata.json"]
},
"golang": {
"command": "gopls",
"args": ["-logfile", "/home/dhollinger/gopls.log", "-rpc.trace"],
"rootPatterns": ["go.mod", ".vim/", ".git/", ".hg/"],
"filetypes": ["go"],
"initializationOptions": {
"usePlaceholders": true
}
},
"bash": {
"command": "bash-language-server",
"args": ["start"],
"filetypes": ["sh"],
"ignoredRootPaths": ["~"]
},
"dockerfile": {
"command": "docker-langserver",
"filetypes": ["dockerfile"],
"args": ["--stdio"]
}
}
}
call plug#begin('~/.config/nvim/plugged')
" My Default Plugs
Plug 'airblade/vim-gitgutter'
Plug 'altercation/vim-colors-solarized'
Plug 'APZelos/blamer.nvim'
Plug 'bitfield/vim-gitgo'
Plug 'bluz71/vim-nightfly-guicolors'
Plug 'cespare/vim-toml'
Plug 'chase/vim-ansible-yaml'
Plug 'christoomey/vim-tmux-navigator'
Plug 'dietsche/vim-lastplace'
Plug 'dracula/vim'
Plug 'easymotion/vim-easymotion'
Plug 'editorconfig/editorconfig-vim'
Plug 'edkolev/tmuxline.vim'
Plug 'ekalinin/Dockerfile.vim'
Plug 'elzr/vim-json'
Plug 'fatih/vim-go'
Plug 'fgsch/vim-varnish'
Plug 'godlygeek/tabular'
Plug 'honza/vim-snippets'
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() } }
Plug 'idanarye/vim-merginal'
Plug 'itchyny/lightline.vim'
Plug 'jacoborus/tender.vim'
Plug 'jez/vim-github-hub'
Plug 'jiangmiao/auto-pairs'
Plug 'joshdick/onedark.vim'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'junegunn/vim-easy-align'
Plug 'keith/rspec.vim'
Plug 'aonemd/kuroi.vim'
Plug 'liuchengxu/space-vim-dark'
Plug 'liuchengxu/vista.vim'
Plug 'marciomazza/vim-brogrammer-theme'
Plug 'mattn/emmet-vim'
Plug 'mattn/webapi-vim'
Plug 'mrk21/yaml-vim'
Plug 'neoclide/coc.nvim', {'do': { -> coc#util#install()}}
Plug 'NLKNguyen/papercolor-theme'
Plug 'powerline/fonts'
Plug 'rafi/vim-unite-issue'
Plug 'rodjek/vim-puppet'
Plug 'rudexi/vim-epp'
Plug 'ryanoasis/vim-devicons'
Plug 'scrooloose/nerdcommenter'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'sebdah/vim-delve'
Plug 'sickill/vim-monokai'
Plug 'sjl/badwolf'
Plug 'terryma/vim-multiple-cursors'
Plug 'tomasiser/vim-code-dark'
Plug 'tpope/vim-bundler'
Plug 'tpope/vim-endwise'
Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rails'
Plug 'tyru/open-browser.vim'
Plug 'vim-ruby/vim-ruby'
Plug 'vimlab/split-term.vim'
Plug 'xuyuanp/nerdtree-git-plugin'
call plug#end()
"""""""""""
" GENERAL "
"""""""""""
" Colors and Theme
set background=dark
set termguicolors
set t_Co=256
set t_ut=
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
colorscheme nightfly
let g:nightflyFloatingFZF = 1
" Global
syntax enable
highlight Comment cterm=italic gui=italic
set splitbelow
set lazyredraw
set showmatch
set mouse=a
set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+,space:.
set list
let g:python_host_prog = '/home/dhollinger/.asdf/shims/python2'
let g:python3_host_prog = '/home/dhollinger/.asdf/shims/python3'
" Set Tabs
set tabstop=4
set softtabstop=4
set expandtab
" Set Folding Options
set foldenable
set foldlevelstart=10
set foldnestmax=10
nnoremap <space> za
set foldmethod=syntax
" Line Numbers
set number relativenumber
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
autocmd BufEnter,FocusGained,InsertLeave NERD_* set norelativenumber nonumber
autocmd BufEnter,FocusGained,InsertLeave __vista__ set norelativenumber nonumber
augroup END
" KeyMaps
noremap <Space> :
let mapleader=","
map <silent> <C-D> :bd<CR>
map <silent> <C-C> :close<CR>
nnoremap <silent> <space>t :tabn<CR>
nnoremap <silent> <space>T :tabp<CR>
noremap <Leader>f :Files<CR>
noremap <Leader>F :Files %:p:h<CR>
noremap <F1> :Helptags<CR>
"""""""""""""""
" END GENERAL "
"""""""""""""""
"""""""
" GIT "
"""""""
let g:gitgutter_realtime = 1
noremap <Leader>v :GFiles<CR>
noremap <Leader>b :Buffers<CR>
noremap <Leader>h :History<CR>
noremap <Leader>gc :Commits<CR>
noremap <Leader>gb :BCommits<CR>
"""""""""""
" END GIT "
"""""""""""
""""""""""""""
" FZF CONFIG "
""""""""""""""
" FZF configuration using ripgrep.
" --column: Show column number
" --line-number: Show line number
" --no-heading: Do not show file headings in results
" --fixed-strings: Search term as a literal string
" --ignore-case: Case insensitive search
" --no-ignore: Do not respect .gitignore, etc...
" --hidden: Search hidden files and folders
" --follow: Follow symlinks
" --glob: Additional conditions for search (in this case ignore everything in the .git/ folder)
" --color: Search color options
command! -bang -nargs=* Rg call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>), 1, <bang>0)
function! FloatingFZF()
let width = float2nr(&columns * 0.85)
let height = float2nr(&lines * 0.70)
let opts = { 'relative': 'editor',
\ 'row': (&lines - height) / 2,
\ 'col': (&columns - width) / 2,
\ 'width': width,
\ 'height': height,
\ 'style': 'minimal'}
let win = nvim_open_win(nvim_create_buf(v:false, v:true), v:true, opts)
endfunction
let g:fzf_layout = { 'window': 'call FloatingFZF()' }
noremap <Leader>/ :FZF<CR>
noremap <Leader>p :Rg<CR>
""""""""""""""""""
" END FZF CONFIG "
""""""""""""""""""
""""""""""""
" COC.NVIM "
""""""""""""
nnoremap <silent> <space>w :exe 'CocList -I --normal --input='.expand('<cword>').' words'<CR>
nnoremap <silent> <space>r :exe 'CocList -I --normal --input='.expand('<cword>').' symbols'<CR>
nnoremap <silent> <space>D :call CocActionAsync('jumpDefinition')<CR>
nnoremap <silent> <space>DV :call CocActionAsync('jumpDefinition', 'vsplit')<CR>
nnoremap <silent> <space>DS :call CocActionAsync('jumpDefinition', 'split')<CR>
nnoremap <silent> <space>DT :call CocActionAsync('jumpDefinition', 'tabe')<CR>
nnoremap <silent> <space>I :call CocActionAsync('jumpDeclaration')<CR>
""""""""""""""""
" END COC.NVIM "
""""""""""""""""
"""""""""""""""""
" BLAMER CONFIG "
"""""""""""""""""
let g:blamer_show_in_visual_modes = 0
let g:blamer_enabled = 1
let g:blamer_delay = 500
highlight Blamer guifg=darkyellow
"""""""""""""""""""""
" END BLAMER CONFIG "
"""""""""""""""""""""
""""""""""""""""
" VISTA CONFIG "
""""""""""""""""
let g:vista_fzf_preview = ['right:50%']
let g:vista_default_executive = 'coc'
nnoremap <silent> <space>v :Vista!!<CR>
noremap <Leader>t :Vista finder coc<CR>
""""""""""""""""""""
" END VISTA CONFIG "
""""""""""""""""""""
""""""""""""
" TMUXLINE "
""""""""""""
let g:tmuxline_preset = {
\'a' : ['#(cd #{pane_current_path}; git rev-parse --abbrev-ref HEAD)', '#S'],
\'b' : ['#I', '#W'],
\'y' : ['#{prefix_highlight}', 'Online: #{online_status}', '%a %h-%d %H:%M'],
\'z' : '#H'}
let g:tmuxline_powerline_separators = 0
""""""""""""""""
" END TMUXLINE "
""""""""""""""""
"""""""""""""
" LIGHTLINE "
"""""""""""""
let g:lightline = {
\ 'colorscheme': 'nightfly',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'cocstatus', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'cocstatus': 'coc#status',
\ },
\ }
"""""""""""""""""
" END LIGHTLINE "
"""""""""""""""""
""""""""""""""""""""
" MULTILINE CURSOR "
""""""""""""""""""""
let g:multi_cursor_select_all_word_key = '<C-A-n>'
let g:multi_cursor_quit_key = '<Esc>'
"let g:multi_cursor_start_key = 'g<C-A-n>'
"let g:multi_cursor_use_default_mapping=0
"let g:multi_cursor_start_word_key = '<C-A-n>'
"let g:multi_cursor_select_all_key = 'g<A-n>'
"let g:multi_cursor_next_key = '<C-A-n>'
"let g:multi_cursor_prev_key = '<C-p>'
"let g:multi_cursor_skip_key = '<C-x>'
""""""""""""""""""""""""
" END MULTILINE CURSOR "
""""""""""""""""""""""""
""""""""""""""
" STATUSLINE "
""""""""""""""
set statusline+=%#warningmsg#
set statusline+=%{coc#status()}
set statusline+=%*
""""""""""""""""""
" END STATUSLINE "
""""""""""""""""""
""""""""""""
" MERGINAL "
""""""""""""
map <silent> <F7> :MerginalToggle<CR>
""""""""""""""""
" END MERGINAL "
""""""""""""""""
""""""""""""
" NERDTREE "
""""""""""""
map <silent> <F5> :NERDTreeToggle<CR>
""""""""""""""""
" END NERDTREE "
""""""""""""""""
"""""""""""""""""""""
" NERDTREE DEVICONS "
"""""""""""""""""""""
autocmd BufEnter * if bufname('#') =~# "^NERD_tree_" && winnr('$') > 1 | b# | endif
let NERDTreeShowHidden=1
let NERDTreeMinimalUI = 1
let NERDTreeDirArrows = 1
let NERDTreeQuitOnOpen = 1
hi Directory guifg=none ctermfg=none
autocmd filetype nerdtree highlight ruby_icon ctermbg=none ctermfg=Red guifg=#cc0000
autocmd filetype nerdtree highlight html_icon ctermbg=none ctermfg=Yellow guifg=#e59400
autocmd filetype nerdtree highlight go_icon ctermbg=none ctermfg=Blue guifg=#6bb8f2
autocmd filetype nerdtree highlight node_modules_icon ctermbg=none ctermfg=Green guifg=#68a063
autocmd filetype nerdtree highlight js_icon ctermbg=none ctermfg=Yellow guifg=#ffff4c
autocmd filetype nerdtree highlight md_icon ctermbg=none ctermfg=Blue guifg=#6bb8f2
autocmd filetype nerdtree highlight docker_icon ctermbg=none ctermfg=Blue guifg=#6bb8f2
autocmd filetype nerdtree highlight heroku_icon ctermbg=none ctermfg=Blue guifg=#6762a6
" if you are using another syn highlight for a given line (e.g.
" NERDTreeHighlightFile) need to give that name in the 'containedin' for this
" other highlight to work with it
autocmd filetype nerdtree syn match ruby_icon ## containedin=NERDTreeFile,ruby
autocmd filetype nerdtree syn match node_modules_icon ## containedin=NERDTreeFile,node_modules
autocmd filetype nerdtree syn match html_icon ## containedin=NERDTreeFile,html
autocmd filetype nerdtree syn match go_icon ## containedin=NERDTreeFile
autocmd filetype nerdtree syn match js_icon ## containedin=NERDTreeFile
autocmd filetype nerdtree syn match md_icon ## containedin=NERDTreeFile
autocmd filetype nerdtree syn match docker_icon ## containedin=NERDTreeFile
autocmd filetype nerdtree syn match heroku_icon ## containedin=NERDTreeFile
"""""""""""""""""""""""""
" END NERDTREE DEVICONS "
"""""""""""""""""""""""""
""""""""""""
" TERMINAL "
""""""""""""
map <Leader>` :Term<CR>
""""""""""""""""
" END TERMINAL "
""""""""""""""""
""""""""""
" VIM-GO "
""""""""""
let g:go_highlight_build_constraints = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_fields = 1
let g:go_highlight_functions = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_function_parameters = 1
let g:go_highlight_methods = 1
let g:go_highlight_operators = 1
let g:go_highlight_structs = 1
let g:go_highlight_types = 1
let g:go_highlight_variable_assignments = 1
let g:go_highlight_variable_declarations = 1
let g:go_auto_sameids = 1
let g:go_addtags_transform = "snakecase"
let g:go_fmt_autosave = 0
let g:go_fmt_fail_silently = 0
""""""""""""""
" END VIM-GO "
""""""""""""""
"""""""""""""""""
" CONFIG GROUPS "
"""""""""""""""""
augroup configgroup
autocmd!
autocmd VimEnter * highlight clear SignColumn
autocmd FileType go setlocal tabstop=4
autocmd FileType go setlocal shiftwidth=4
autocmd FileType go setlocal softtabstop=4
autocmd FileType go setlocal noexpandtab
autocmd FileType ruby setlocal tabstop=2
autocmd FileType ruby setlocal shiftwidth=2
autocmd FileType ruby setlocal softtabstop=2
autocmd FileType ruby setlocal commentstring=#\ %s
autocmd FileType php setlocal tabstop=4
autocmd FileType php setlocal shiftwidth=4
autocmd FileType php setlocal softtabstop=4
autocmd BufNewFile,BufRead *.pp set syntax=puppet
autocmd FileType puppet setlocal tabstop=2
autocmd FileType puppet setlocal shiftwidth=2
autocmd FileType puppet setlocal softtabstop=2
autocmd FileType puppet setlocal expandtab
autocmd FileType puppet setlocal commentstring=#\ %s
autocmd FileType python setlocal tabstop=4
autocmd FileType python setlocal shiftwidth=4
autocmd FileType python setlocal softtabstop=4
autocmd FileType python setlocal expandtab
autocmd FileType python setlocal commentstring=#\ %s
autocmd BufEnter *.cls setlocal filetype=java
autocmd BufEnter *.jsx setlocal tabstop=2
autocmd BufEnter *.jsx setlocal shiftwidth=2
autocmd BufEnter *.jsx setlocal softtabstop=2
autocmd BufEnter *.jsx setlocal expandtab
autocmd BufEnter *.json setlocal filetype=json
autocmd BufEnter *.json setlocal tabstop=2
autocmd BufEnter *.json setlocal shiftwidth=2
autocmd BufEnter *.json setlocal softtabstop=2
autocmd BufEnter *.json setlocal expandtab
autocmd BufEnter *.zsh-theme setlocal filetype=zsh
autocmd BufEnter Makefile setlocal noexpandtab
autocmd BufEnter *.sh setlocal tabstop=4
autocmd BufEnter *.sh setlocal shiftwidth=4
autocmd BufEnter *.sh setlocal softtabstop=4
augroup END
"""""""""""""""""""""
" END CONFIG GROUPS "
"""""""""""""""""""""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment