Skip to content

Instantly share code, notes, and snippets.

@coyove
Last active September 18, 2023 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coyove/d2607e7be0bf9a977a3c0edc5d044172 to your computer and use it in GitHub Desktop.
Save coyove/d2607e7be0bf9a977a3c0edc5d044172 to your computer and use it in GitHub Desktop.
set nocompatible " be iMproved, required
set enc=utf-8
set tenc=utf-8
set fenc=utf-8
set fencs=utf-8,usc-bom
set cursorline
set autoindent
set backspace=indent,eol,start
set number
set incsearch
set showmatch
set ignorecase
set infercase
set smartcase
set tabstop=4
set shiftwidth=4
set expandtab
set guioptions-=m "remove menu bar
set guioptions-=T "remove toolbar
set guicursor=
set nowrap " do not automatically wrap on load
set formatoptions-=t " do not automatically wrap text when typing
set path+=**
set cmdheight=2
if has("win32")
execute ":call system('if not exist %UserProfile%\\.vim\\backup mkdir %UserProfile%\\.vim\\backup')"
execute ":call system('if not exist %UserProfile%\\.vim\\swap mkdir %UserProfile%\\.vim\\swap')"
execute ":call system('if not exist %UserProfile%\\.vim\\undo mkdir %UserProfile%\\.vim\\undo')"
tnoremap <C-D> <C-\><C-n>:q!<CR>
set shell=C:\\Program\ Files\\Git\\bin\\bash.exe
set shellpipe=|
set shellredir=$
set shellcmdflag=
else
execute ":call system('mkdir -p ~/.vim/backup')"
execute ":call system('mkdir -p ~/.vim/swap')"
execute ":call system('mkdir -p ~/.vim/undo')"
endif
set backupdir=~/.vim/backup//
set directory=~/.vim/swap//
set undodir=~/.vim/undo//
nnoremap Q <Nop>
nnoremap <C-d> 15<C-d>
nnoremap <C-u> 15<C-u>
nnoremap <C-J> gT
nnoremap <C-K> gt
inoremap <C-C> <Esc>
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'ervandew/supertab'
Plugin 'vim-airline/vim-airline'
Plugin 'prabirshrestha/async.vim'
Plugin 'prabirshrestha/asyncomplete.vim'
Plugin 'prabirshrestha/asyncomplete-lsp.vim'
Plugin 'prabirshrestha/vim-lsp'
Plugin 'mattn/vim-lsp-settings'
Plugin 'mattn/vim-goimports'
" Plugin 'davidhalter/jedi-vim'
call vundle#end() " required
filetype plugin indent on " required
syntax on
set t_Co=256
autocmd BufWritePre *.go LspDocumentFormatSync
nnoremap <C-]> :LspDefinition<CR>
nnoremap gd :LspDefinition<CR>
let g:SuperTabDefaultCompletionType = "<c-x><c-o>"
"colorscheme pablo
" syn keyword Keyword break default func interface select case
" \ defer go map struct chan else goto package switch
" \ const fallthrough if range type continue for import return var
set completeopt=longest,menuone
set foldmethod=indent
set foldlevel=99
command Zs execute ":cd %:p:h"
command Zn execute "norm :tabnew %:p\<CR>:Zs\<CR>:e.\<CR>"
command W execute ":w"
command ZZ execute "norm :LspStopServer\<CR>:sleep 1\<CR>:e!%:p\<CR>"
command Ter execute ":ter"
function Mygrep(name)
if has("win32")
execute "vimgrep " . a:name . " **"
else
execute "silent grep! -rinI " . a:name . " ."
endif
execute ":copen"
call feedkeys("\<C-W>L")
endfunction
command! -nargs=1 Zf call Mygrep(<f-args>)
autocmd InsertEnter * setlocal nocursorline
autocmd VimEnter,InsertLeave * setlocal cursorline
autocmd VimEnter,InsertLeave * hi CursorLine gui=underline
autocmd CursorHold * normal! m'
autocmd InsertEnter * normal! m'
set wildignore=*/vendor/*,*/clients/*,*/thrift_gen/*,*/log/*,*/test/*
hi Pmenu ctermbg=gray guibg=gray guifg=black
hi PmenuSel ctermbg=black guibg=black guifg=white
hi TabLine ctermfg=black ctermbg=white
hi MatchParen guibg=NONE ctermbg=NONE term=BOLD cterm=BOLD,UNDERLINE
hi StatusLine ctermfg=15 guifg=#ffffff ctermbg=100 guibg=#4e4e4e cterm=bold gui=bold
hi StatusLineNC ctermfg=249 guifg=#b2b2b2 ctermbg=237 guibg=#3a3a3a cterm=none gui=none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment