Skip to content

Instantly share code, notes, and snippets.

@AceroM
Last active June 17, 2020 04:46
Show Gist options
  • Save AceroM/6d089ad751ffdcb5bcab06529d834dc6 to your computer and use it in GitHub Desktop.
Save AceroM/6d089ad751ffdcb5bcab06529d834dc6 to your computer and use it in GitHub Desktop.
vimrc for windows subsystem linux
set mouse=a
set relativenumber
set hlsearch
set guicursor= "what the cursor looks like
set number
set tabstop=2 softtabstop=2 expandtab shiftwidth=2 smarttab
set undodir=~/.vim/undodir
set noshowmatch
set nocompatible
set noswapfile
set nobackup
set nowrap
set termguicolors
set scrolloff=9
set cmdheight=2
set updatetime=50
set colorcolumn=80
highlight ColorColumn ctermbg=0 guibg=lightgrey
syntax on
syntax enable
filetype off "vundle required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'sheerun/vim-polyglot'
Plugin 'ThePrimeagen/vim-be-good', {'do': './install.sh'}
Plugin 'neoclide/coc.nvim', {'branch': 'release'}
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'tpope/vim-abolish'
Plugin 'junegunn/fzf', {'do': { -> fzf#install() } }
Plugin 'junegunn/fzf.vim'
Plugin 'morhetz/gruvbox'
Plugin 'francoiscabrol/ranger.vim'
Plugin 'mbbill/undotree'
Plugin 'joereynolds/vim-minisnip'
Plugin 'govim/govim'
"Plugin 'fatih/vim-go'
Plugin 'majutsushi/tagbar'
call vundle#end()
filetype plugin indent on
let &t_SI = "\e[6 q"
let &t_EI = "\e[2 q"
" optional reset cursor on start:
augroup myCmds
au!
autocmd VimEnter * silent !echo -ne "\e[2 q"
autocmd vimenter * colorscheme gruvbox
augroup END
let g:gruvbox_contrast_dark = 'hard'
colorscheme gruvbox
set background=dark
let mapleader = " "
" Remaps
nnoremap <leader>w :w<cr>
nnoremap <leader>q :q!<cr>
nnoremap <leader>n :noh<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>+ :vertical resize +5<CR>
nnoremap <Leader>- :vertical resize -5<CR>
nnoremap <Leader>y "*y<CR>
nnoremap <Leader>p "*p<CR>
" File stuff
nnoremap <C-p> :GFiles<CR>
nnoremap <leader>pf :Files<CR>
nnoremap <leader>u :UndotreeShow<CR>
" Ripgrep
nnoremap <leader>ps :Rg<SPACE>
" Tagbar
nnoremap <leader>t :TagbarToggle<CR>
" 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
" --- 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
" copy (write) highlighted text to .vimbuffer
vmap <C-c> y:new ~/.vimbuffer<CR>VGp:x<CR> \| :!cat ~/.vimbuffer \| clip.exe
" <CR><CR>
" paste from buffer
map <C-v> :r ~/.vimbuffer<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment