Skip to content
the poor coder

vimrc configuration

Poor Man
Published
Reading time
2 min read
On this page

Vimrc Configuration#

As someone who spends most of their time in the terminal, Vim is one of my favorite text editors. One of the reasons I prefer it over other editors is the ability to customize it to my needs. Vim's configuration file is called .vimrc and it allows you to modify hundreds of settings to suit your needs.

Basic Configuration#

Here are some basic configuration options that I find useful:

VIM
" Highlighting syntax
syntax on

" Enable line numbers
set number

" Enable mouse support in terminal
set mouse=a

" Enable auto-indentation
set autoindent

" Enable text wrap
set wrap

Plugins and Plugin Managers#

Vim has a vast amount of plugins that can enhance your editing experience. Some of the plugins that I use are:

  • Vundle - A plugin manager for Vim
  • NERDTree - A file explorer for Vim
  • Airline - A fancy status bar that shows various information
  • Fugitive - A Git wrapper
  • UltiSnips - A snippet manager

To install these plugins, you need a plugin manager. Vundle is one of the most popular ones. Here's how you can install Vundle:

VIM
" Install Vundle
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

" Configure Vundle
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'vim-airline/vim-airline'
Plugin 'tpope/vim-fugitive'
Plugin 'SirVer/ultisnips'
call vundle#end()

This code should be placed at the top of your .vimrc file, before any other plugin configurations.

Custom Keybindings#

Vim allows you to customize your keybindings. Here are some of the keybindings that I use:

VIM
" Map leader key to comma
let mapleader = ","

" Quickly save a file
nmap <leader>s :w<CR>

" Quickly open NERDTree
nmap <leader>n :NERDTreeToggle<CR>

The first line maps the leader key to the comma key. The next two lines create shortcuts for saving a file and opening NERDTree respectively. The nmap command is used to create normal mode mappings.

Keep going

2023

how to sort an array

How to Sort an Array If you have an array and you want to order its elements in a specific way, you need to use a sorting algorithm. There are several sorting algorithms available, but two of the most commonly used are…

javascript2 min read
2023

jquery mobile or desktop

jQuery Mobile or Desktop? As a web developer, I have had some experience with both jQuery Mobile and jQuery Desktop. Both frameworks have their pros and cons, and which one to use really depends on the specific project…

javascript1 min read
2023

node.js folder structure

Node.js Folder Structure If you are new to Node.js, it can be daunting to create a folder structure that will work for your project. The structure you choose will depend on the size and complexity of your project. Here…

javascript1 min read
ESC