Skip to content

Instantly share code, notes, and snippets.

@MindFlavor
Last active February 27, 2021 18:54
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 MindFlavor/920292f4b189233d468de11ff7d61ed4 to your computer and use it in GitHub Desktop.
Save MindFlavor/920292f4b189233d468de11ff7d61ed4 to your computer and use it in GitHub Desktop.
my current vimrc
syntax on
syntax enable
filetype plugin indent on
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.local/share/nvim/plugged')
Plug 'tpope/vim-sensible'
Plug 'scrooloose/nerdtree'
Plug 'rust-lang/rust.vim'
Plug 'godlygeek/tabular'
Plug 'vim-airline/vim-airline'
Plug 'tpope/vim-fugitive'
Plug 'vim-airline/vim-airline-themes'
Plug 'ardagnir/united-front'
Plug 'zah/nim.vim'
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
Plug 'mhartington/oceanic-next'
call plug#end()
set background=dark
set undofile
set undodir=~/.vim/undo
" number of undo saved
set undolevels=100000
let g:lsp_highlight_references_enabled = 1
let g:lsp_diagnostics_enabled = 1 " disable diagnostics support
let g:lsp_signs_enabled = 1 " enable signs
let g:lsp_diagnostics_echo_cursor = 1 " enable echo under cursor when in normal mode
let mapleader = " "
" this will sync the unnamed register
" with the OS's clipboard
set clipboard=unnamedplus
augroup filetype_rust
autocmd!
autocmd BufReadPost *.rs setlocal filetype=rust
augroup END
let g:rustfmt_autosave = 1
let g:airline_theme = 'oceanicnext'
set number
map <C-t> :NERDTreeToggle<CR>
noremap <F2> :LspRename<CR>
noremap <leader><F3> :LspPreviousError<CR>
noremap <F3> :LspNextError<CR>
noremap <leader><F4> :LspPreviousWarning<CR>
noremap <F4> :LspNextWarning<CR>
noremap <silent> <F5> :LspCodeAction<CR>
noremap <silent> <F6> :LspImplementation<CR>
noremap <silent> <leader> <F7> :LspPreviousReference<CR>
noremap <silent> <F7> :LspNextReference<CR>
noremap <silent> <F9> :tab LspDefinition<CR>
noremap <silent> gd :LspDefinition<CR>
noremap <silent> <F12> :LspHover<CR>
noremap <silent> K :LspHover<CR>
noremap <silent> <leader>p :LspPeekDefinition<CR>
noremap <silent> <leader>r :LspReferences<CR>
noremap <silent> <C-Left> :tabmove -1<CR>
noremap <silent> <C-Right> :tabmove +1<CR>
noremap <silent> <S-Right> :vertical resize +1<CR>
noremap <silent> <S-Left> :vertical resize -1<CR>
noremap <silent> <S-Down> :resize +1<CR>
noremap <silent> <S-Up> :resize -1<CR>
nnoremap <Right> <C-w>l
nnoremap <Left> <C-w>h
nnoremap <Up> <C-w>k
nnoremap <Down> <C-w>j
nnoremap <Tab> gt
nnoremap <S-Tab> gT
let g:airline_powerline_fonts = 1
set t_Co=256
if (has("termguicolors"))
set termguicolors
endif
let g:oceanic_next_terminal_bold = 1
let g:oceanic_next_terminal_italic = 1
colorscheme OceanicNext
set completeopt-=preview
" Required for operations modifying multiple buffers like rename.
set hidden
"if executable('rls')
" au User lsp_setup call lsp#register_server({
" \ 'name': 'rls',
" \ 'cmd': {server_info->['rustup', 'run', 'nightly', 'rls']},
" \ 'whitelist': ['rust'],
" \ })
"endif
if executable('rust-analyzer')
au User lsp_setup call lsp#register_server({
\ 'name': 'rust-analyzer',
\ 'cmd': {server_info->['rustup', 'run', 'nightly', 'rust-analyzer']},
\ 'whitelist': ['rust'],
\ })
endif
com! FormatXML :%!python3 -c "import xml.dom.minidom, sys; print(xml.dom.minidom.parse(sys.stdin).toprettyxml())"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment