Skip to content

Instantly share code, notes, and snippets.

@giner
Last active August 18, 2025 09:46
Show Gist options
  • Save giner/e7d7313dc678937f3b5f618843462d96 to your computer and use it in GitHub Desktop.
Save giner/e7d7313dc678937f3b5f618843462d96 to your computer and use it in GitHub Desktop.
VIM: Turn Vim into IDE (LSP + Autocomplete + tiny tweaks)
#!/bin/bash
vimrc_path=~/.vimrc
vim_plugins_dir=~/.vim/pack/plugins/start
# VIM: Basic tweaks
cp --backup=numbered /dev/null "$vimrc_path"
sed 's/^ \{2\}//' > "$vimrc_path" << 'EOF'
source $VIMRUNTIME/defaults.vim
set tabpagemax=100 " Maximum number of tab pages to be opened by the `-p` command line argument (default: 10)
set viminfo='100,h " Change to unlimited number of lines/kbytes saved for each register (default: '100,<50,s10,h)
set history=1000 " Remember more commands and search patterns in history (default: 50)
set spell " Enable spell checking
" Highlight trailing whitespaces
augroup highlight-whitespaces | autocmd! | autocmd BufEnter * match Error /\s\+$/ | augroup END
EOF
# VIM: Install plugins
mkdir -p "$vim_plugins_dir"
plugins=(
# LSP and Autocomplete
https://github.com/prabirshrestha/vim-lsp
https://github.com/mattn/vim-lsp-settings
https://github.com/prabirshrestha/asyncomplete.vim
https://github.com/prabirshrestha/asyncomplete-lsp.vim
# Status line
https://github.com/vim-airline/vim-airline
# Optional: Autoformat (LSP partially covers Autoformat but not everything)
#https://github.com/vim-autoformat/vim-autoformat
)
for plugin in "${plugins[@]}"; do
[[ -d "$vim_plugins_dir/$(basename "$plugin")" ]] || git -C "$vim_plugins_dir" clone "$plugin"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment