Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " Basic Configuration
- " ------------------
- syntax on
- set backspace=indent,eol,start
- " Turn on filetype plugin
- filetype plugin on
- " Enable italics
- set t_ZH=^[[3m
- set t_ZR=^[[23m
- " Hide command line when not being used (Nvim only)
- " set cmdheight=0
- " Tab Settings
- " ------------
- set tabstop=2 " Tabs are 2 spaces
- set shiftwidth=2 " Using > indents 2 spaces
- set autoindent " Indent where possible
- set nowrap " Remove wrapping for coding files
- set nonumber " Disable line numbers
- " Auto Commands
- " -------------
- " Markdown specific settings
- autocmd FileType markdown setlocal wrap
- autocmd FileType markdown setlocal nonumber
- " Key Bindings
- " ------------
- " Window resizing
- noremap <silent> <M-Left> :vertical resize -10<CR>
- noremap <silent> <M-Right> :vertical resize +10<CR>
- noremap <silent> <M-Up> :resize -10<CR>
- noremap <silent> <M-Down> :resize +10<CR>
- " Close current buffer
- noremap <leader>x <cmd>bp\|bd#<cr>
- " Mac specific fixes for function keys
- nmap <F1> :NERDTreeToggle<CR>
- nmap <Leader><F1> :NERDTreeFind<CR>
- nmap <F8> :TagbarToggle<CR>
- nmap <F7> :UndotreeToggle<CR>
- " Easier shift-hjkl movement
- nnoremap <C-J> <C-W>j
- nnoremap <C-K> <C-W>k
- nnoremap <C-L> <C-W>l
- nnoremap <C-H> <C-W>h
- " Plugins
- " -------
- call plug#begin()
- " Theme plugins
- Plug 'sonph/onehalf', { 'rtp': 'vim' }
- Plug 'kaicataldo/material.vim', { 'branch': 'main' }
- Plug 'sainnhe/everforest'
- Plug 'rakr/vim-one'
- Plug 'NLKNguyen/papercolor-theme'
- Plug 'markvincze/panda-vim'
- Plug 'jacoborus/tender.vim'
- Plug 'mhartington/oceanic-next'
- Plug 'kyoz/purify', { 'rtp': 'vim' }
- Plug 'altercation/vim-colors-solarized'
- Plug 'reedes/vim-colors-pencil'
- Plug 'mswift42/vim-themes'
- Plug 'Brettm12345/moonlight.vim'
- Plug 'ghifarit53/tokyonight-vim'
- Plug 'cormacrelf/vim-colors-github'
- Plug 'tssm/c64-vim-color-scheme'
- " Dev icons
- Plug 'ryanoasis/vim-devicons'
- " Helper plugins
- Plug 'godlygeek/tabular' " Align text
- Plug 'tpope/vim-eunuch' " VIM helpers (delete, rename, move)
- Plug 'ctrlpvim/ctrlp.vim' " Open anything plugin
- Plug 'mileszs/ack.vim' " Grep replace tool
- Plug 'vim-test/vim-test' " Runs PHPUnit tests
- Plug 'majutsushi/tagbar' " Shows tab and tags collections
- Plug 'universal-ctags/ctags' " Builds ctags automatically
- Plug 'preservim/nerdtree' " File explorer
- Plug 'jistr/vim-nerdtree-tabs' " NERDTree tabs
- Plug 'tpope/vim-fugitive' " Git support (diff)
- Plug 'vim-vdebug/vdebug' " Debugger for Vim
- Plug 'reedes/vim-pencil' " Soft wrapping
- Plug 'craigemery/vim-autotag' " Automatically builds ctags
- Plug 'junegunn/goyo.vim' " Distraction-free writing
- Plug 'itchyny/lightline.vim' " Status bar for Vim
- call plug#end()
- " Plugin Configuration
- " --------------------
- " COC Configuration
- " -----------------
- " Some servers have issues with backup files, see #649
- set nobackup
- set nowritebackup
- " Disable COC for markdown files
- function! s:disable_coc_for_type()
- let l:filesuffix_blacklist = ['markdown', 'md', 'mkd']
- if index(l:filesuffix_blacklist, expand('%:e')) != -1
- let b:coc_enabled = 0
- endif
- endfunction
- autocmd BufRead,BufNewFile * call s:disable_coc_for_type()
- " Always show the signcolumn
- set signcolumn=yes
- " Reduce updatetime for better responsiveness
- set updatetime=300
- " Keybindings for COC
- inoremap <silent><expr> <TAB> coc#pum#visible() ? coc#pum#next(1) : CheckBackspace() ? "\<Tab>" : coc#refresh()
- inoremap <silent><expr> <S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
- inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
- inoremap <silent><expr> <c-space> coc#refresh()
- nnoremap <silent> K :call <SID>show_documentation()<CR>
- " 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)
- " Symbol renaming
- nmap <leader>rn <Plug>(coc-rename)
- " Formatting selected code
- xmap <leader>f <Plug>(coc-format-selected)
- nmap <leader>f <Plug>(coc-format-selected)
- " Applying code actions to the selected code block
- xmap <leader>a <Plug>(coc-codeaction-selected)
- nmap <leader>a <Plug>(coc-codeaction-selected)
- " Apply code actions at cursor position
- nmap <leader>ac <Plug>(coc-codeaction-cursor)
- " Apply code actions to entire buffer
- nmap <leader>as <Plug>(coc-codeaction-source)
- " Apply the most preferred quickfix action to fix diagnostic on the current line
- nmap <leader>qf <Plug>(coc-fix-current)
- " Remap keys for refactor code actions
- nmap <silent> <leader>re <Plug>(coc-codeaction-refactor)
- xmap <silent> <leader>r <Plug>(coc-codeaction-refactor-selected)
- nmap <silent> <leader>r <Plug>(coc-codeaction-refactor-selected)
- " Run Code Lens action on the current line
- nmap <leader>cl <Plug>(coc-codelens-action)
- " Pencil (Wrap) Settings
- " ----------------------
- let g:pencil#wrapModeDefault = 'soft' " Default is 'hard'
- augroup pencil
- autocmd!
- autocmd FileType markdown,mkd,md call pencil#init()
- autocmd FileType text call pencil#init()
- augroup END
- " Lightline Settings
- " ------------------
- call lightline#init()
- " Goyo Settings
- " -------------
- function! s:auto_goyo()
- if &ft == 'markdown'
- Goyo 80
- elseif exists('#goyo')
- let bufnr = bufnr('%')
- Goyo!
- execute 'b '.bufnr
- endif
- endfunction
- augroup goyo_markdown
- autocmd!
- autocmd BufEnter * call s:auto_goyo()
- augroup END
- " Color Scheme
- " ------------
- colorscheme deus
- set background=dark
- " Post Scheme Formatting
- " ----------------------
- " Clear certain highlighting settings
- highlight clear SignColumn
- highlight clear FoldColumn
- hi Folded ctermfg=100 guifg=NONE guibg=NONE ctermbg=NONE
- hi TabLineFill term=bold cterm=bold ctermbg=0
- hi TabLine ctermfg=NONE ctermbg=NONE
- hi TabLineSel ctermfg=NONE ctermbg=NONE
- hi SpecialKey guifg=NONE ctermfg=NONE guibg=NONE
- hi Normal guibg=NONE ctermbg=NONE
- hi CursorColumn cterm=NONE ctermbg=NONE ctermfg=NONE
- hi CursorLine cterm=NONE ctermbg=NONE ctermfg=NONE
- hi LineNr guibg=NONE ctermbg=NONE
- hi CursorLineNr guibg=NONE ctermbg=NONE
- hi EndOfBuffer guibg=NONE ctermbg=NONE guifg=#343d46 ctermfg=NONE
- " Set comments to italic style
- highlight Comment cterm=italic gui=italic
- " Miscellaneous Settings
- " ----------------------
- set noshowmode
- set noshowcmd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement