Skip to content

Instantly share code, notes, and snippets.

@ianchanning
Created February 23, 2023 00:36
Show Gist options
  • Save ianchanning/a538b681ad425b529c69da17ff35ac82 to your computer and use it in GitHub Desktop.
Save ianchanning/a538b681ad425b529c69da17ff35ac82 to your computer and use it in GitHub Desktop.
VSCode subset of my main .vimrc file
let data_dir=has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
set nocompatible
call plug#begin('~/.vim/bundle')
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-commentary'
call plug#end()
nnoremap <space> <nop>
let mapleader="\<space>"
let g:mapleader="\<space>"
try
autocmd FileType php setlocal commentstring=\/\/\ %s
autocmd FileType javascript setlocal commentstring=\/\/\ %s
autocmd FileType reason setlocal commentstring=\/\/\ %s
autocmd FileType dosbatch setlocal commentstring=rem\ %s
autocmd FileType rust setlocal commentstring=//\ %s
catch
endtry
map <leader>' ysiw'
map <leader>" ysiw"
map <leader>; A;<esc>
map <silent> <leader><cr> :nohlsearch<cr>
nnoremap <leader>bb :buffers<cr>:b<space>
map <leader>s :w<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment