This .vimrc
file is a comprehensive Vim configuration aimed at improving the productivity and experience of developers, especially those working with TypeScript, JavaScript, HTML, and related technologies. It includes a range of plugins for file navigation, syntax highlighting, Git integration, and much more, ensuring a seamless development workflow within the Vim editor.
-
Prerequisite: Vim-Plug
- This configuration uses vim-plug as the plugin manager. Ensure you have vim-plug installed before proceeding.
- For Unix-based systems, you can install vim-plug with the following command:
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
-
Configuring Vim
- Backup your current
.vimrc
file if necessary. - Replace the contents of your
.vimrc
file with the configuration provided. - Open Vim and run
:PlugInstall
to install the plugins.
- Backup your current
- NERDTree and Extensions: For file system exploration.
- fzf and fzf.vim: Fuzzy file finding within Vim.
- vim-gitgutter and vim-fugitive: Enhanced Git integration.
- Syntax Highlighting: Support for TypeScript, JavaScript, HTML, and more.
- vim-surround, vim-airline: Improved text manipulation and Vim UI enhancements.
- coc.nvim: IntelliSense engine for Vim.
- ...and many others for enhancing your Vim experience.
- Line numbers, relative line numbers, syntax highlighting, and UTF-8 encoding are enabled by default.
- Custom key bindings include:
jk
for exiting insert mode.Ctrl+n
to toggle NERDTree.++
for toggling comments in normal and visual modes.Ctrl+p
andLeader + pf
for file searching.
- Additional key mappings are provided for efficient navigation and code manipulation.
- NERDTree is configured to show Git status flags and ignore certain directories (e.g.,
node_modules
). - CoC (Conquer of Completion) is set up with global extensions for snippets, linting, formatting, and more, improving code completion and analysis.
- Includes functions and commands for syncing NERDTree with the current file, organizing imports, formatting code, and more.
- Custom Tmux navigation mappings if you're using Vim within Tmux.