Skip to content

Instantly share code, notes, and snippets.

@Meeshbhoombah
Last active March 20, 2021 19:43
Show Gist options
  • Save Meeshbhoombah/7d9e0cd2e1f850d51a64b6b59f945484 to your computer and use it in GitHub Desktop.
Save Meeshbhoombah/7d9e0cd2e1f850d51a64b6b59f945484 to your computer and use it in GitHub Desktop.
Vim Config
" ***** VUNDLE *****
set nocompatible " be improved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'wakatime/vim-wakatime'
Plugin 'alvan/vim-closetag'
Plugin 'cakebaker/scss-syntax.vim'
Plugin 'vim-airline/vim-airline'
Plugin 'cespare/vim-toml'
Plugin 'tomlion/vim-solidity'
Plugin 'racer-rust/vim-racer'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
" ***** CONFIGURATION *****
" Syntax highlighting
syntax on
" Tabwidth
set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab
set t_Co=256
" Nowrap
set nowrap
" Relative line numbers
set number relativenumber
" Switch to regular when in insert mode
" https://www.reddit.com/r/unixporn/comments/d79yj4/i3gaps_cooling_elegance/f0ypivp/
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
augroup END
" Remove buffer preview
set completeopt-=preview
set mouse=a
set number
highlight LineNr ctermfg=grey
set numberwidth=3
set linespace=10
set backspace=indent,eol,start
" Tabwidth
autocmd FileType html setlocal ts=2 sts=2 sw=2
autocmd FileType javascript setlocal ts=4 sts=4 sw=4
" Handlebars
au BufNewFile,BufRead *.handlebars set filetype=html
" Allow tag closing for *.handlebars, *.hdbs
let g:closetag_filenames = '*.html,*.xhtml,*.phtml,*.handlebars,*.hdbs'
" 'racer-rust/vim-racer' config
let g:racer_cmd = "/Users/akm/.cargo/bin/racer"
" buffers hidden to avoid saving after each goto
set hidden
augroup Racer
autocmd!
autocmd FileType rust nmap <buffer> gd <Plug>(rust-def)
autocmd FileType rust nmap <buffer> gs <Plug>(rust-def-split)
autocmd FileType rust nmap <buffer> gx <Plug>(rust-def-vertical)
autocmd FileType rust nmap <buffer> gt <Plug>(rust-def-tab)
autocmd FileType rust nmap <buffer> <leader>gd <Plug>(rust-doc)
autocmd FileType rust nmap <buffer> <leader>gD <Plug>(rust-doc-tab)
augroup END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment