Skip to content

Instantly share code, notes, and snippets.

@Civitasv
Last active June 5, 2022 12:19
Show Gist options
  • Save Civitasv/593e7837f7d7fa0308e5dbbcbca7ffc8 to your computer and use it in GitHub Desktop.
Save Civitasv/593e7837f7d7fa0308e5dbbcbca7ffc8 to your computer and use it in GitHub Desktop.
Visual Studio VSVIM Settings
source ~/nvim/settings.vim
source ~/nvim/mappings.vim
" basics
nnoremap ' `
vnoremap . :normal .<CR>
vnoremap ` :normal @a<CR>
nnoremap ` @a
nmap j gj
nmap k gk
nnoremap U <C-r>
inoremap jj <esc>
nnoremap <leader>nh :noh<CR>
" editor navigate
nnoremap <c-e> :vsc View.SolutionExplorer<CR>
" navigate
nnoremap <c-o> :vsc View.NavigateBackward<CR>
nnoremap <c-i> :vsc View.NavigateForward<CR>
" comment
nnoremap gc :vsc Edit.ToggleLineComment<cr>
vnoremap gc :vsc Edit.ToggleBlockComment<cr>
" lsp stuff
nnoremap gi :vsc Edit.GoToImplementaation<CR>
nnoremap gd :vsc Edit.GoToDefinition<cr>
nnoremap gr :vsc Edit.FindAllReferences<cr>
nnoremap <leader>rn :vsc Refactor.Rename<CR>
" methods list
nnoremap <leader>mm :vsc ClassDiagram.NavigatetoMethods<CR>
" open
nnoremap <leader>od :vsc File.OpenContainingFolder<CR>
nnoremap <leader>os :vsc Edit.QuickFindSymbol<CR>
" format
nnoremap == :vsc Edit.FormatDocument<CR>
" built in search looks better
nnoremap <C-s> :vsc Edit.FindinFiles<cr>
" build stuff
nnoremap <leader>bc :vsc Build.Compile<cr>
nnoremap <leader>bb :vsc Build:BuildSolution<cr>
" debug stuff
nnoremap <leader>db :vsc Debug.ToggleBreakpoint<cr>
" see all breakpoints
nnoremap <leader>dr :vsc Debug.Breakpoints<cr>
nnoremap <leader>ds :vsc Debug.StopDebugging<cr>
nnoremap <leader>dd :vsc Debug.Start<cr>
" fullscreen
nnoremap <leader>fs :vsc View.FullScreen<cr>
" <C-R>
nnoremap <C-r> :vsc Redo<CR>
" tab
nnoremap <Tab> :vsc Window.NextTab<CR>
nnoremap <S-Tab> :vsc Window.PreviousTab<CR>
" window
nnoremap <leader>n :vsc Window.NextDocumentWindow<CR>
nnoremap <leader>p :vsc Window.PreviousDocumentWindow<CR>
" error
nnoremap ]l :vsc View.ErrorList<CR>
nnoremap ]n :vsc View.NextError<CR>
nnoremap ]p :vsc View.PreviousError<CR>
" docs
nnoremap K :vsc Edit.QuickInfo<CR>
" search
vnoremap * "/y/<C-r>/<CR>
vnoremap # "/y?<C-r>/<CR>
let mapleader=' '
set relativenumber
" enables the clipboard between Neovim and other applications
set clipboard=unnamed
" Highlight search results
set hlsearch
" real time search result shown
set incsearch
" Ignore case when searching
set ignorecase
" When searching try to be smart about cases
set smartcase
set shiftwidth=4
set expandtab
set scrolloff=5
set showcmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment