Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " Vim Configuration
- "==============================================================================
- " Neovim: ~/.local/share/nvim/plugged
- call plug#begin()
- "==========================================================================="
- "==========================================================================="
- "=============================["General:"]=================================="
- "==========================================================================="
- "||
- "Vimrc:
- Plug 'iliubang/vimrc'
- "||
- "Tables:
- Plug 'dhruvasagar/vim-table-mode'
- "||
- "ImageMagick:
- Plug 'tpope/vim-afterimage'
- "||
- "CapsLock:
- "Plug 'tpope/vim-capslock'
- "||
- "Status:
- Plug 'tpope/vim-flagship'
- Plug 'tpope/vim-airline'
- "||
- "Dotfiles:
- Plug 'tpope/vim-dotenv'
- "||
- "JSON:
- Plug 'tpope/vim-jdaddy'
- "||
- "Characters:(UNICODE/UTF-8):
- Plug 'tpope/vim-characterize'
- "||
- "Movement:
- Plug 'tpope/vim-endwise'
- Plug 'tpope/vim-repeat'
- "||
- "Alignment:
- Plug 'junegunn/vim-easy-align'
- "||
- "TextObjects:
- Plug 'tpope/vim-sensible'
- Plug 'tpope/vim-surround'
- "||
- "Theme:
- Plug 'tyrannicaltoucan/vim-deep-space'
- Plug 'tpope/vim-vividchalk'
- "||
- "Snippets:
- Plug 'honza/vim-snippets'
- "||
- "Filemanager:
- Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
- Plug 'tpope/vim-apathy'
- "// EXAMPLE:
- "|| gf, <C-W>f, <C-W>gf: jump to the included file under the cursor.
- "|| :find, :sfind, :tabfind: jump to the specified included file.
- Plug 'tpope/vim-eunuch'
- "// EXAMPLE:
- "|| Vim sugar for the UNIX shell commands that need it the most. Features include:
- "|| :Delete: Delete a buffer and the file on disk simultaneously.
- "|| :Unlink: Like :Delete, but keeps the now empty buffer.
- "|| :Move: Rename a buffer and the file on disk simultaneously.
- "|| :Rename: Like :Move, but relative to the current file's containing directory.
- "|| :Chmod: Change the permissions of the current file.
- "|| :Mkdir: Create a directory, defaulting to the parent of the current file.
- "|| :Cfind: Run find and load the results into the quickfix list.
- "|| :Clocate: Run locate and load the results into the quickfix list.
- "|| :Lfind/:Llocate: Like above, but use the location list.
- "|| :Wall: Write every open window. Handy for kicking off tools like guard.
- "|| :SudoWrite: Write a privileged file with sudo.
- "|| :SudoEdit: Edit a privileged file with sudo.
- "||
- "||
- "Database:
- Plug 'tpope/vim-dadbod'
- "// EXAMPLE: :DB postgresql:///foobar
- "|| :DB redis:
- "||
- "Fuzzy:
- Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
- "||
- "Tmux:
- Plug 'tpope/vim-tbone'
- "||
- "Commenting:
- "||
- "||
- "Session:
- Plug 'tpope/vim-obsession'
- "||
- "Git:
- Plug 'NoahOrberg/gilbert.nvim'
- Plug 'tpope/vim-git'
- Plug 'tpope/vim-fugitive'
- Plug 'tpope/vim-rhubarb'
- "// EXAMPLE:
- "|| Enables :Gbrowse from fugitive.vim to open GitHub URLs.
- "|| Sets up :Git to use hub if installed rather than git.
- "||
- "Paste:
- Plug 'dunstontc/snip'
- Plug 'maxbrunsfeld/vim-yankstack'
- "// EXAMPLE: For example, if you wanted to define some mappings based on your 'leader' key, you could do this:
- "|| nmap <leader>p <Plug>yankstack_substitute_older_paste
- "|| nmap <leader>P <Plug>yankstack_substitute_newer_paste
- "||
- Plug 'svermeulen/vim-yoink'
- "// EXAMPLE:
- "|| Note that by default Yoink will not affect the way Vim behaves in any
- "|| way. You have to add one or more of the following maps or enable one
- "|| of the optional settings to produce an effect.
- "||
- "|| For example, if you want to add a key to swap the most recent paste
- "|| around in the yank history:
- "||
- "|| nmap <c-n> <plug>(YoinkPostPasteSwapBack)
- "|| nmap <c-p> <plug>(YoinkPostPasteSwapForward)
- "||
- "|| nmap p <plug>(YoinkPaste_p)
- "|| nmap P <plug>(YoinkPaste_P)
- "||
- "|| :Yanks - Display the current yank history
- "|| :ClearYanks - Delete history. This will reduce the history down to
- "|| 1 entry taken from the default register.
- "||
- "Search:
- Plug 'svermeulen/vim-subversive'
- "||
- "||
- "[]"End:"General:[]========================================================="
- "==========================================================================="
- "==========================================================================="
- "===============["Specific Programming Language Plugins:"]=================="
- "==========================================================================="
- "||
- "HAML:
- Plug 'tpope/vim-haml'
- "||
- "Markdown:
- Plug 'junegunn/goyo.vim', { 'for': 'markdown' }
- Plug '/tpope/vim-markdown'
- "||
- "[]"End:"Markdown:"[]========================================================"
- "============================================================================"
- "||
- "C:
- "||
- "[]"End:"C:"[]=============================================================="
- "============================================================================"
- "||
- "Rust:
- Plug 'alx741/vim-rustfmt'
- Plug 'ebfe/vim-racer'
- Plug 'timonv/vim-cargo'
- Plug 'rust-lang/rust.vim'
- "||
- "[]"End:"Rust:"[]=============================================================="
- "==========================================================================="
- "||
- "CPP:
- Plug 'octol/vim-cpp-enhanced-highlight', { 'for': 'cpp' }
- "||
- "[]"End:"CPP:"[]============================================================"
- "==========================================================================="
- "Go:Golang:golang:
- "||
- Plug 'ajswis/vim-colorful-go'
- Plug 'webhat/gocovim'
- Plug 'netdigger/vim-config'
- Plug 'jasontbradshaw/pigeon.vim'
- Plug 'b0o/quicktemplate.vim'
- Plug 'pilere/vim_go_runtime'
- Plug 'enriqueChen/vimrc4go'
- Plug 'tenfyzhong/golint-fixer.vim'
- Plug 'heavenshell/vim-golinter'
- Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
- Plug 'sebdah/vim-delve'
- Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }
- Plug 'rhysd/unite-go-import.vim'
- Plug 'AdnanHodzic/vim-hue'
- "||
- "+=["Go:]["Autocomplete:]
- Plug 'prabirshrestha/asyncomplete-file.vim'
- Plug 'prabirshrestha/async.vim'
- Plug 'prabirshrestha/asyncomplete.vim'
- Plug 'prabirshrestha/asyncomplete-buffer.vim'
- Plug 'prabirshrestha/asyncomplete-gocode.vim'
- "||
- "[]"End:"Go:"[]==========================================================="
- "==========================================================================="
- "Ruby:
- "||
- Plug 'tpope/vim-rvm'
- Plug 'tpope/vim-hashrocket'
- Plug 'tpope/vim-bundler'
- "+===["Ruby:]["Rails:]
- "||
- Plug 'tpope/vim-cucumber'
- Plug 'tpope/vim-rails'
- Plug 'tpope/vim-rake'
- "||
- "[]"End:"Ruby:"[]==========================================================="
- call plug#end()
- "============================================================================="
- "||
- " Convert tabs to spaces, use 2 spaces for tabs
- set expandtab
- set tabstop=2
- set shiftwidth=2
- "||
- " Jump to the last position when reopening a file
- if has("autocmd")
- au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
- endif
- "||
- " Nerdtree Settings - Key Assignment
- nnoremap <C-a> :tabprevious<CR>
- nnoremap <C-d> :tabnext<CR>
- nnoremap <C-s> :tabnew<CR>:NERDTree<CR>
- " Theme
- set background=dark
- set termguicolors
- colorscheme deep-space
- function! g:FuckThatMatchParen ()
- if exists(":NoMatchParen")
- :NoMatchParen
- endif
- endfunction
- augroup plugin_initialize
- autocmd!
- autocmd VimEnter * call FuckThatMatchParen()
- augroup END
- " Aliasing
- command Q q
- command Qw wq
- command W w
- command Wq wq
- "cmap q qa
- imap <c-space> <Plug>(asyncomplete_force_refresh)
- set completeopt-=preview
- let g:asyncomplete_smart_completion = 1
- let g:asyncomplete_auto_popup = 1
- let g:asyncomplete_remove_duplicates = 1
- autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif
- call asyncomplete#register_source(asyncomplete#sources#gocode#get_source_options({
- \ 'name': 'gocode',
- \ 'whitelist': ['go'],
- \ 'completor': function('asyncomplete#sources#gocode#completor'),
- \ 'config': {
- \ 'gocode_path': expand('~/Development/bin/gocode')
- \ },
- \ }))
- au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#file#get_source_options({
- \ 'name': 'file',
- \ 'whitelist': ['*'],
- \ 'priority': 10,
- \ 'completor': function('asyncomplete#sources#file#completor')
- \ }))
- call asyncomplete#register_source(asyncomplete#sources#buffer#get_source_options({
- \ 'name': 'buffer',
- \ 'whitelist': ['*'],
- \ 'blacklist': ['go'],
- \ 'completor': function('asyncomplete#sources#buffer#completor'),
- \ }))
- " Use `tab` key to select completions. Default is arrow keys.
- "inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
- "inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
- " Use tab to trigger auto completion. Default suggests completions as you type.
- "let g:completor_auto_trigger = 0
- let g:completor_gocode_binary = '/usr/bin/gocode'
- set relativenumber
- set textwidth=80
- au BufRead,BufNewFile *.md setlocal textwidth=80
- " Return to previous line if file previously opened
- if has("autocmd")
- au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
- \| exe "normal! g'\"" | endif
- endif
- set undofile
- set undodir=~/.config/nvim/undo/
- set backupdir=~/.config/nvim/backup/
- set directory=~/.config/nvim/tmp
- tnoremap <Esc> <C-\><C-n>
- "10sp also works
- "split | Explore | resize 50
- "
- nmap <leader>p <Plug>yankstack_substitute_older_paste
- nmap <leader>P <Plug>yankstack_substitute_newer_paste
- let g:yankstack_yank_keys = ['y', 'd']
- let g:markdown_fenced_languages = ['html', 'python', 'bash=sh']
- let g:markdown_minlines = 999
- function! s:isAtStartOfLine(mapping)
- let text_before_cursor = getline('.')[0 : col('.')-1]
- let mapping_pattern = '\V' . escape(a:mapping, '\')
- let comment_pattern = '\V' . escape(substitute(&l:commentstring, '%s.*$', '', ''), '\')
- return (text_before_cursor =~? '^' . ('\v(' . comment_pattern . '\v)?') . '\s*\v' . mapping_pattern . '\v$')
- endfunction
- inoreabbrev <expr> <bar><bar>
- \ <SID>isAtStartOfLine('\|\|') ?
- \ '<c-o>:TableModeEnable<cr><bar><space><bar><left><left>' : '<bar><bar>'
- inoreabbrev <expr> __
- \ <SID>isAtStartOfLine('__') ?
- \ '<c-o>:silent! TableModeDisable<cr>' : '__'
- let g:table_mode_corner_corner='+'
- let g:table_mode_header_fillchar='='
- " write file whenever you try to GoBuild
- set autowrite
- "allow copy/paste from sys clipboard
- set clipboard=unnamed
- " run :GoBuild or :GoTestCompile based on the go file
- function! s:build_go_files()
- let l:file = expand('%')
- if l:file =~# '^\f\+_test\.go$'
- call go#cmd#Test(0, 1)
- elseif l:file =~# '^\f\+\.go$'
- call go#cmd#Build(0)
- endif
- endfunction
- autocmd FileType go nmap <leader>b :<C-u>call <SID>build_go_files()<CR>
- autocmd FileType go nmap <Leader>i <Plug>(go-info)
- autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4
- let g:go_auto_type_info = 1
- let g:go_auto_sameids = 1
- let g:go_highlight_types = 1
- let g:go_highlight_fields = 1
- let g:go_highlight_functions = 1
- let g:go_highlight_methods = 1
- let g:go_highlight_operators = 1
- let g:go_highlight_extra_types = 1
- set updatetime=100
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement