Skip to content

Instantly share code, notes, and snippets.

@mustardandrew
Last active August 6, 2021 12:48
Show Gist options
  • Save mustardandrew/462f8699ca96673ed4f253f04e1cec9e to your computer and use it in GitHub Desktop.
Save mustardandrew/462f8699ca96673ed4f253f04e1cec9e to your computer and use it in GitHub Desktop.
Vim configuration
--langdef=markdown
--langmap=markdown:.mkd
--regex-markdown=/^#[ \t]+(.*)/\1/h,Heading_L1/
--regex-markdown=/^##[ \t]+(.*)/\1/i,Heading_L2/
--regex-markdown=/^###[ \t]+(.*)/\1/k,Heading_L3/
--langdef=css
--langmap=css:.css.less.scss
--regex-css=/^[ \t]*@([A-Za-z0-9_-]+)/@\1/v,var,variables/
--regex-css=/^[ \t]*\.([A-Za-z0-9_-]+)/.\1/c,class,classes/
--regex-css=/^[ \t]*#([A-Za-z0-9_-]+)/#\1/i,id,ids/
--regex-css=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/
--regex-css=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" https://github.com/VundleVim/Vundle.vim#quick-start
Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/nerdcommenter'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'kien/ctrlp.vim'
Plugin 'jiangmiao/auto-pairs'
Plugin 'mattn/emmet-vim'
Plugin 'moll/vim-bbye'
" Need install exuberant-ctags
" sudo apt install exuberant-ctags
Plugin 'majutsushi/tagbar'
Plugin 'mtscout6/vim-tagbar-css'
Plugin 'jwalton512/vim-blade'
" Colors
Plugin 'damage220/solas.vim'
Plugin 'StanAngeloff/php.vim'
call vundle#end()
filetype plugin indent on
set nocp
set number
let NERDTreeShowHidden=1
" Theme
syntax enable
colorscheme solas
" Plugin NerdTree
map <C-n> :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
let g:NERDTreeDirArrowExpandable = '>'
let g:NERDTreeDirArrowCollapsible = '<'
" NerdCommenter
" Add spaces after comment delimiters by default
let g:NERDSpaceDelims = 1
" Use compact syntax for prettified multi-line comments
let g:NERDCompactSexyComs = 1
" Align line-wise comment delimiters flush left instead of following code indentation
let g:NERDDefaultAlign = 'left'
" Set a language to use its alternate delimiters by default
let g:NERDAltDelims_java = 1
" Add your own custom formats or override the defaults
let g:NERDCustomDelimiters = { 'c': { 'left': '/**','right': '*/' } }
" Allow commenting and inverting empty lines (useful when commenting a region)
let g:NERDCommentEmptyLines = 1
" Enable trimming of trailing whitespace when uncommenting
let g:NERDTrimTrailingWhitespace = 1
" AirLine
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#fnamemod = ':t'
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
let g:airline#extensions#tabline#formatter = 'unique_tail'
let g:airline_theme='solarized'
" Move to the next buffer
nmap <C-t> :bnext<CR>
" CtrlP
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn)$',
\ 'file': '\v\.(exe|so|dll)$',
\ 'link': 'some_bad_symbolic_links',
\ }
" Buy buffer
nmap <C-c> :Bdelete<CR>
" Emmet
let g:user_emmet_expandabbr_key = '<c-e>'
let g:user_emmet_install_global = 0
autocmd FileType html,css,php EmmetInstall
" Tagbar
nmap <F8> :TagbarToggle<CR>
let g:tagbar_iconchars = ['+', '-']
let g:tagbar_type_php = {
\'ctagstype': 'php',
\'kinds': [
\'i:interfaces',
\'c:classes',
\'d:constants',
\'f:functions'
\]
\}
let g:tagbar_type_markdown = {
\ 'ctagstype' : 'markdown',
\ 'kinds' : [
\ 'h:Heading_L1',
\ 'i:Heading_L2',
\ 'k:Heading_L3'
\ ]
\ }
let g:tagbar_type_css = {
\ 'ctagstype' : 'css',
\ 'kinds' : [
\ 'c:classes',
\ 's:selectors',
\ 'i:identities'
\ ]
\ }
" Basis
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set smartindent
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
Launch vim and run :PluginInstall
To install from command line: vim +PluginInstall +qall
sudo apt-get install exuberant-ctags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment