Skip to content

Instantly share code, notes, and snippets.

@mmacphail
Last active November 15, 2019 22:53
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 mmacphail/5e81e951f876611a16b7a0884e7418a7 to your computer and use it in GitHub Desktop.
Save mmacphail/5e81e951f876611a16b7a0884e7418a7 to your computer and use it in GitHub Desktop.
Config .vimrc
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()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'itchyny/lightline.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'airblade/vim-gitgutter'
Plugin 'alvan/vim-closetag'
" 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
" Requiered for lightline.vim plugin to work
" See https://github.com/itchyny/lightline.vim
set laststatus=2
" Config for closetag plugin
" See https://github.com/alvan/vim-closetag
" filenames like *.xml, *.html, *.xhtml, ...
" These are the file extensions where this plugin is enabled.
"
let g:closetag_filenames = '*.xml,*.html,*.xhtml,*.phtml'
" filenames like *.xml, *.xhtml, ...
" This will make the list of non-closing tags self-closing in the specified files.
"
let g:closetag_xhtml_filenames = '*.xhtml,*.jsx'
" filetypes like xml, html, xhtml, ...
" These are the file types where this plugin is enabled.
"
let g:closetag_filetypes = 'xml,html,xhtml,phtml'
" filetypes like xml, xhtml, ...
" This will make the list of non-closing tags self-closing in the specified files.
"
let g:closetag_xhtml_filetypes = 'xhtml,jsx'
" integer value [0|1]
" This will make the list of non-closing tags case-sensitive (e.g. `<Link>` will be closed while `<link>` won't.)
"
let g:closetag_emptyTags_caseSensitive = 1
" dict
" Disables auto-close if not in a "valid" region (based on filetype)
"
let g:closetag_regions = {
\ 'typescript.tsx': 'jsxRegion,tsxRegion',
\ 'javascript.jsx': 'jsxRegion',
\ }
" Shortcut for closing tags, default is '>'
"
let g:closetag_shortcut = '>'
" Add > at current position without closing the current tag, default is ''
"
let g:closetag_close_shortcut = '<leader>>'
" Options for handling tabs and spacing
" See https://stackoverflow.com/questions/2054627/how-do-i-https://manjaro.org/change-tab-size-in-vim/40008101
" Also https://tedlogan.com/techblog3.html
autocmd Filetype xml setlocal softtabstop=4
autocmd Filetype xml setlocal shiftwidth=4
autocmd Filetype xml setlocal expandtab
autocmd Filetype java setlocal softtabstop=4
autocmd Filetype java setlocal shiftwidth=4
autocmd Filetype java setlocal expandtab
" Sets the line number
" See https://www.cyberciti.biz/faq/vi-show-line-numbers/
set number
" Syntaxic coloring
syntax on
@mmacphail
Copy link
Author

mmacphail commented Nov 13, 2019

Renaming a tag can be done using the following command : cst new tagname
See https://github.com/tpope/vim-surround for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment