Skip to content

Instantly share code, notes, and snippets.

@Arzte
Created February 27, 2017 17:33
Show Gist options
  • Save Arzte/89b47f9eda00eb4768a1f03c021c00dd to your computer and use it in GitHub Desktop.
Save Arzte/89b47f9eda00eb4768a1f03c021c00dd to your computer and use it in GitHub Desktop.
let g:python_host_prog = '/usr/bin/python2'
let g:python3_host_prog = '/usr/bin/python3'
" Specify a directory for plugins (for Neovim: ~/.local/share/nvim/plugged)
call plug#begin('~/.vim/plugged')
" Appearance
" Vim-Airline
Plug 'vim-airline/vim-airline'
" Fancy Startscreen
Plug 'mhinz/vim-startify'
" A good dark theme
Plug 'joshdick/onedark.vim'
" Usability
" Automatically toggles relative line numbers
Plug 'jeffkreeftmeijer/vim-numbertoggle'
" reopen files at last edit position
Plug 'dietsche/vim-lastplace'
" Auto pair brackets
Plug 'jiangmiao/auto-pairs'
" Mark Trailing Whitespaces
Plug 'ntpeters/vim-better-whitespace'
" NERD Tree Filebrowser
Plug 'scrooloose/nerdtree'
" Display open buffers
Plug 'bling/vim-bufferline'
" Easier navigation
Plug 'easymotion/vim-easymotion'
" Git stuff in Vim
Plug 'jreybert/vimagit'
" Makes vim adhear to .editorconfig
Plug 'editorconfig/editorconfig-vim'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'sebastianmarkow/deoplete-rust'
Plug 'SevereOverfl0w/deoplete-github'
Plug 'carlitux/deoplete-ternjs'
Plug 'ternjs/tern_for_vim', { 'do': 'npm install' }
Plug 'slashmili/alchemist.vim'
" enhance built-in features
" changes how vim stores undo files
Plug 'pixelastic/vim-undodir-tree'
" session backup and restore
Plug 'tpope/vim-obsession'
" edit gpg encrypted files
Plug 'vim-scripts/gnupg.vim'
" automatically toggles relative line numbers
Plug 'jeffkreeftmeijer/vim-numbertoggle'
" make <C-a> and <C-x> compatable with dates, times, etc
Plug 'tpope/vim-speeddating'
" reopen files at last edit position
Plug 'dietsche/vim-lastplace'
" add the ability to macro some plugins
Plug 'tpope/vim-repeat'
" more syntax
Plug 'wellle/targets.vim'
" clear search highlight upon cursor move
" Plug 'pgdouyon/vim-evanesco'
" language-specific
" multi-lang syntax files
Plug 'sheerun/vim-polyglot'
" clojure
Plug 'guns/vim-clojure-static'
Plug 'guns/vim-clojure-highlight'
Plug 'guns/vim-sexp'
Plug 'tpope/vim-sexp-mappings-for-regular-people'
" csv
Plug 'chrisbra/csv.vim'
" d
Plug 'idanarye/vim-dutyl'
" f#
Plug 'fsharp/vim-fsharp'
" haskell
Plug 'dag/vim2hs'
Plug 'eagletmt/neco-ghc'
Plug 'pbrisbin/vim-syntax-shakespeare'
" html
Plug 'rstacruz/sparkup'
Plug 'Valloric/MatchTagAlways'
" java
Plug 'vim-scripts/JavaDecompiler.vim'
Plug 'artur-shaik/vim-javacomplete2'
Plug 'rustushki/JavaImp.vim'
Plug 'tpope/vim-classpath'
" latex
Plug 'lervag/vimtex'
" markdown
Plug 'suan/vim-instant-markdown'
" python
Plug 'jmcantrell/vim-virtualenv'
" ruby
Plug 'tpope/vim-rails'
" scss
Plug 'cakebaker/scss-syntax.vim'
" browse the current file's tags
Plug 'majutsushi/tagbar'
" Rust
Plug 'rust-lang/rust.vim'
Plug 'racer-rust/vim-racer'
Plug 'cespare/vim-toml'
Plug 'autozimu/LanguageClient-neovim', { 'do': ':UpdateRemotePlugins' }
" Optional dependency for symbol selection
Plug 'junegunn/fzf'
" linting
" syntax checking
Plug 'scrooloose/syntastic'
" other
" wraps/unwraps brackets
Plug 'vim-scripts/argwrap.vim'
" auto-pairs brackets, quotes, etc
Plug 'jiangmiao/auto-pairs'
" aligns things
Plug 'junegunn/vim-easy-align'
" snippets
Plug 'sirver/UltiSnips'
Plug 'honza/vim-snippets'
" ack
Plug 'mileszs/ack.vim'
" file browser
Plug 'scrooloose/nerdtree'
Plug 'jistr/vim-nerdtree-tabs'
" shows git status per-line
Plug 'airblade/vim-gitgutter'
" visual undo tree
Plug 'mbbill/undotree'
" unix command emulation
Plug 'tpope/vim-eunuch'
" git command integration
Plug 'tpope/vim-fugitive'
" github addon for vim-fugitive
Plug 'tpope/vim-rhubarb'
" personal wiki/diary/checklist/everything
Plug 'vimwiki/vimwiki'
" color picker
Plug 'KabbAmine/vCoolor.vim'
" use vim as system manpager
Plug 'lambdalisue/vim-manpager'
" easily surround text
Plug 'tpope/vim-surround'
" useful shortcuts
Plug 'tpope/vim-unimpaired'
" comment/uncomment areas of text
Plug 'tpope/vim-commentary'
" easy search/jump within small areas
Plug 'justinmk/vim-sneak'
" Initialize plugin system
call plug#end()
set clipboard+=unnamedplus
filetype plugin indent on
syntax enable
let mapleader=' '
set encoding=utf-8
scriptencoding utf-8
" Case-insensitive pathname tab completion
set wildignorecase
" Persistent undo
set undodir=~/.config/nvim/.undo//
set backupdir=~/.config/nvim/.backup//
set directory=~/.config/nvim/.swp//
set undofile
" Better searching
set ignorecase smartcase incsearch showmatch hlsearch
nnoremap <C-L> :noh<CR><C-L>
" show more information
set showmode showcmd ruler
" Show relative line numbers and never let cursor touch top/bottom
set relativenumber scrolloff=5
" convenience
imap <Nul> <Esc><Leader>
set noesckeys
set noshowmode
set laststatus=2
" cursor shapes
if has('nvim')
let $NVIM_TUI_ENABLE_CURSOR_SHAPE = 1
else
let &t_SI = "\<esc>[5 q"
let &t_SR = "\<esc>[5 q"
let &t_EI = "\<esc>[2 q"
end
" Buffer navigation
nnoremap <C-RIGHT> :bn<CR>
nnoremap <C-LEFT> :bp<CR>
" Save root files
cnoremap w!! w !sudo tee %
" Set colorscheme
syntax on
colorscheme onedark
" Indentation
filetype plugin indent on
set tabstop=4 shiftwidth=4 softtabstop=4 expandtab autoindent
" Don't abandon buffers
set hidden
" Language-specific
au FileType css set ts=2 sw=2 sts=2
au FileType html set ts=2 sw=2 sts=2
au FileType rust nnoremap <C-b> :w<CR>:Neomake! cargo<CR>
" Plugin Configs
" Vim-Airline
"let g:airline_theme='base16'
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
"let g:lightline = {
" \ 'colorscheme': 'onedark',
" \ }
let g:onedark_terminal_italics=1
let g:airline_theme='onedark'
let g:onedark_termcolors=16
" Airline symbols
"if !exists('g:airline_symbols')
" let g:airline_symbols = {}
"endif
" Vim Airline theme stuff
" airline symbols
"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.linenr = '␊'
"let g:airline_symbols.linenr = '␤'
"let g:airline_symbols.linenr = '¶'
"let g:airline_symbols.branch = '⎇'
"let g:airline_symbols.paste = 'ρ'
"let g:airline_symbols.paste = 'Þ'
"let g:airline_symbols.paste = '∥'
"let g:airline_symbols.whitespace = 'Ξ'
"let g:airline_symbols.branch = ''
"let g:airline_symbols.readonly = ''
"let g:airline_symbols.linenr = ''
"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
if (empty($TMUX))
if (has("nvim"))
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
if (has("termguicolors"))
set termguicolors
endif
endif
if !has('gui_running')
set t_Co=256
endif
" Better Whitespace Plugin
highlight ExtraWhitespace ctermbg=01
" Rust.vim
let g:rustfmt_autosave = 1
" Language server for rust
" Required for operations modifying multiple buffers like rename.
set hidden
let g:LanguageClient_serverCommands = {
\ 'rust': ['cargo', 'run', '--release', '--manifest-path=/opt/rls/Cargo.toml'],
\ }
nnoremap <silent> K :call LanguageClient_textDocument_hover()<CR>
nnoremap <silent> gd :call LanguageClient_textDocument_definition()<CR>
nnoremap <silent> <F2> :call LanguageClient_textDocument_rename()<CR>
" Vim-racer
let g:racer_experiomental_completer = 1
" Neosnippet
if has('conceal')
set conceallevel=2 concealcursor=niv
endif
" Bufferline
let g:bufferline_show_bufnr = 0
let g:bufferline_active_buffer_left = ''
let g:bufferline_active_buffer_right = ''
let g:bufferline_active_highlight = 'BufferLineSel'
let g:bufferline_inactive_highlight = 'BufferLine'
" NERDTree
let g:NERDTreeDirArrowExpandable = ''
let g:NERDTreeDirArrowCollapsible = ''
" EasyMotion
" Mapping to <Leader> might result in issues
map <Leader> <Plug>(easymotion-prefix)
" Editorconfig
" Set editorconfig to not work on remote files over ssh
let g:EditorConfig_exclude_patterns = ['scp://.*']
" Remappings
" spellcheck
map <silent> <F2> :setlocal spell! spelllang=en_us<CR>
imap <silent> <F2> <C-o>:setlocal spell! spelllang=en_us<CR>
" plugin configs
" ArgWrap
nnoremap <silent> <leader>aw :ArgWrap<cr>
" clang-format
let g:clang_format#style_options = {
\ "AccessModifierOffset" : -4,
\ "AllowShortIfStatementsOnASingleLine" : "true",
\ "AlwaysBreakTemplateDeclarations" : "true",
\ "Standard" : "C++11"}
autocmd FileType c,cpp,objc nnoremap <buffer><Leader>cf :<C-u>ClangFormat<cr>
autocmd FileType c,cpp,objc vnoremap <buffer><Leader>cf :ClangFormat<cr>
" Color Picker
nnoremap <A-c> :ColorPicker<cr>
inoremap <A-c> :ColorPicker<cr>
" EasyAlign
xmap ga <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign)
nnoremap gA ga
" IndentLine
let g:indentLine_concealcursor = ''
let g:indentLine_conceallevel = 1
let g:indentLine_char = '|'
" JavaImp
let g:JavaImpPaths = "/usr/lib/jvm"
let g:JavaImpDocPaths = "/usr/share/doc/java8-openjdk"
let g:JavaImpDataDir = $HOME . "/.vim/JavaImp"
" Neco-ghc
autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc
" NerdTree-tabs
nmap <Leader>n :NERDTreeTabsToggle<cr>
" NumberToggle
let g:NumberToggleTrigger=''
" Polyglot
let g:polyglot_disabled = ['python']
" Syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_rust_clippy_post_args = ['--release', '--', '-Dclippy', '-Wclippy_pendantic']
let g:syntastic_html_tidy_ignore_errors = [
\ 'trimming empty <i>'
\ ]
let g:syntastic_java_javac_config_file_enabled = 1
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_scss_checkers = ['scss_lint']
" Tagbar
nmap <F8> :TagbarToggle<cr>
" UltiSnips
let g:UltiSnipsExpandTrigger="<C-j>"
let g:UltiSnipsJumpForwardTrigger="<C-j>"
let g:UltiSnipsJumpBackwardTrigger="<C-k>"
" Undotree
nnoremap <F5> :UndotreeToggle<cr>
" Vimtex
let g:tex_flavor='latex'
let g:Tex_DefaultTargetFormat='pdf'
let g:Tex_ViewRule_pdf='gv 2>/dev/null'
let g:vimtex_viewer_zathura = 1
let g:vimtex_view_general_viewer = 'zathura'
" VimWiki
let g:vimwiki_list = [
\ {
\ 'path': '~/doc/vimwiki',
\ 'auto_export': 0,
\ 'auto_toc': 1,
\ 'syntax': 'markdown', 'ext': '.md'
\ }
\]
let g:vimwiki_folding='list'
let g:vimwiki_global_ext = 0
" Deoplete
let g:deoplete#enable_at_startup = 1
let g:deoplete#sources#rust#racer_binary = '/home/benjamin/.cargo/bin/racer'
let g:deoplete#sources#rust#rust_source_path = '~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/'
" Use deoplete.
let g:tern_request_timeout = 1
let g:tern_show_signature_in_pum = '0' " This do disable full signature type on autocomplete
"Add extra filetypes
let g:tern#filetypes = [
\ 'jsx',
\ 'javascript.jsx',
\ 'vue',
\ '...'
\ ]
" deoplete tab-complete
inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
if !exists('g:deoplete#omni#input_patterns')
let g:deoplete#omni#input_patterns = {}
endif
" let g:deoplete#disable_auto_complete = 1
autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment