Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- syntax on
- set guicursor=
- set noshowmatch
- set relativenumber
- set nohlsearch
- set hidden
- set noerrorbells
- set tabstop=4 softtabstop=4
- set shiftwidth=4
- set expandtab
- set smartindent
- set nu
- set nowrap
- set smartcase
- set noswapfile
- set nobackup
- set undodir=~/.config/nvim/undodir
- set undofile
- set incsearch
- set termguicolors
- set scrolloff=8
- set noshowmode
- " Give more space for displaying messages.
- set cmdheight=2
- " Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
- " delays and poor user experience.
- set updatetime=50
- " Don't pass messages to |ins-completion-menu|.
- set shortmess+=c
- set colorcolumn=80
- highlight ColorColumn ctermbg=0 guibg=lightgrey
- call plug#begin('~/.config/nvim/plugged')
- Plug 'neoclide/coc.nvim', {'branch': 'release'}
- Plug 'tweekmonster/gofmt.vim'
- Plug 'tpope/vim-fugitive'
- Plug 'mbbill/undotree'
- Plug 'sheerun/vim-polyglot'
- Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
- Plug 'junegunn/fzf.vim'
- Plug 'vuciv/vim-bujo'
- Plug 'tpope/vim-dispatch'
- Plug 'tell-k/vim-autopep8'
- Plug 'mattn/emmet-vim'
- Plug 'pangloss/vim-javascript'
- Plug 'tpope/vim-commentary'
- Plug 'preservim/nerdtree'
- " I AM SO SORRY FOR DOING COLOR SCHEMES IN MY VIMRC, BUT I HAVE
- " TOOOOOOOOOOOOO
- Plug 'gruvbox-community/gruvbox'
- Plug 'sainnhe/gruvbox-material'
- Plug 'phanviet/vim-monokai-pro'
- Plug 'vim-airline/vim-airline'
- " Plug 'itchyny/lightline.vim'
- Plug 'flazz/vim-colorschemes'
- call plug#end()
- let g:gruvbox_contrast_dark = 'hard'
- if exists('+termguicolors')
- let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
- let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
- endif
- let g:gruvbox_invert_selection='0'
- " --- vim go (polyglot) settings.
- 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_methods = 1
- let g:go_highlight_operators = 1
- let g:go_highlight_structs = 1
- let g:go_highlight_types = 1
- let g:go_highlight_function_parameters = 1
- let g:go_highlight_function_calls = 1
- let g:go_highlight_generate_tags = 1
- let g:go_highlight_format_strings = 1
- let g:go_highlight_variable_declarations = 1
- let g:go_auto_sameids = 1
- " Disbale vim-autopep8 diff window
- let g:autopep8_disable_show_diff=1
- colorscheme gruvbox
- set background=dark
- if executable('rg')
- let g:rg_derive_root='true'
- endif
- let loaded_matchparen = 1
- let mapleader = " "
- let g:netrw_browse_split = 2
- let g:netrw_banner = 0
- let g:netrw_winsize = 25
- nnoremap <leader>prw :CocSearch <C-R>=expand("<cword>")<CR><CR>
- nnoremap <leader>pw :Rg <C-R>=expand("<cword>")<CR><CR>
- nnoremap <leader>phw :h <C-R>=expand("<cword>")<CR><CR>
- nnoremap <leader>h :wincmd h<CR>
- nnoremap <leader>j :wincmd j<CR>
- nnoremap <leader>k :wincmd k<CR>
- nnoremap <leader>l :wincmd l<CR>
- nnoremap <leader>u :UndotreeShow<CR>
- nnoremap <leader>pv :wincmd v<bar> :Ex <bar> :vertical resize 30<CR>
- nnoremap <Leader>ps :Rg<SPACE>
- nnoremap <C-p> :GFiles<CR>
- nnoremap <Leader>pf :Files<CR>
- nnoremap <Leader><CR> :so ~/.config/nvim/init.vim<CR>
- nnoremap <Leader>+ :vertical resize +5<CR>
- nnoremap <Leader>- :vertical resize -5<CR>
- nnoremap <Leader>rp :resize 100<CR>
- nnoremap <Leader>ee oif err != nil {<CR>log.Fatalf("%+v\n", err)<CR>}<CR><esc>kkI<esc>
- vnoremap J :m '>+1<CR>gv=gv
- vnoremap K :m '<-2<CR>gv=gv
- noremap <leader>/ :Commentary<cr>
- noremap <C-n> :NERDTreeToggle<CR>
- " vim TODO
- nmap <Leader>tu <Plug>BujoChecknormal
- nmap <Leader>th <Plug>BujoAddnormal
- let g:bujo#todo_file_path = $HOME . "/.cache/bujo"
- " Vim with me
- nnoremap <leader>vwm :colorscheme gruvbox<bar>:set background=dark<CR>
- nmap <leader>vtm :highlight Pmenu ctermbg=gray guibg=gray
- vnoremap X "_d
- inoremap <C-c> <esc>
- function! s:check_back_space() abort
- let col = col('.') - 1
- return !col || getline('.')[col - 1] =~# '\s'
- endfunction
- command! -nargs=0 Prettier :CocCommand prettier.formatFile
- inoremap <silent><expr> <C-space> coc#refresh()
- " GoTo code navigation.
- nmap <leader>gd <Plug>(coc-definition)
- nmap <leader>gy <Plug>(coc-type-definition)
- nmap <leader>gi <Plug>(coc-implementation)
- nmap <leader>gr <Plug>(coc-references)
- nmap <leader>rr <Plug>(coc-rename)
- nmap <leader>g[ <Plug>(coc-diagnostic-prev)
- nmap <leader>g] <Plug>(coc-diagnostic-next)
- nmap <silent> <leader>gp <Plug>(coc-diagnostic-prev-error)
- nmap <silent> <leader>gn <Plug>(coc-diagnostic-next-error)
- nnoremap <leader>cr :CocRestart
- " Sweet Sweet FuGITive
- nmap <leader>gh :diffget //3<CR>
- nmap <leader>gu :diffget //2<CR>
- nmap <leader>gs :G<CR>
- " Lightline
- " let g:lightline = {
- " \ 'colorscheme': 'wombat',
- " \ 'active': {
- " \ 'left': [ [ 'mode', 'paste' ],
- " \ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
- " \ },
- " \ 'component_function': {
- " \ 'gitbranch': 'FugitiveHead'
- " \ },
- " \ }
- fun! TrimWhitespace()
- let l:save = winsaveview()
- keeppatterns %s/\s\+$//e
- call winrestview(l:save)
- endfun
- augroup highlight_yank
- autocmd!
- autocmd TextYankPost * silent! lua require'vim.highlight'.on_yank("IncSearch", 50)
- augroup END
- autocmd BufWritePre * :call TrimWhitespace()
- "python with virtualenv support
- let g:python3_host_prog = "/usr/bin/python"
- py << EOF
- import os
- import sys
- if 'VIRTUAL_ENV' in os.environ:
- project_base_dir = os.environ['VIRTUAL_ENV']
- activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
- execfile(activate_this, dict(__file__=activate_this))
- EOF
- " Auto Formatting
- nnoremap <C-f> :Prettier<CR>
- " Indentation for Python
- au BufNewFile,BufRead *.py
- \set autoindent
- \set fileformat=unix
- " Indentation for JS
- au BufNewFile,BufRead *.js
- \set shiftwidth=2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement