06 August 2023

My .vimrc

" set linewidth      
set textwidth=78     

set encoding=utf-8   
set fileencoding=utf-8

" enable syntax highlighting
syntax enable        

" show line numbers  
set number           

" set tabs to have 4 spaces
set ts=4             

" indent when moving to the next line while writing code
set autoindent       

" expand tabs into spaces
set expandtab        
                     
" when using the >> or << commands, shift lines by 4 spaces
set shiftwidth=4

" show a visual line under the cursor's current line
" set cursorline        
                        
" show the matching part of the pair for [] {} and ()
set showmatch           

set guifont=Consolas:h11

" avoid word breaking at end of each screen line
set linebreak           

" enable all Python syntax highlighting features
let python_highlight_all = 1

set splitbelow          
set splitright          

nmap <C-h> <C-w>h       
nmap <C-j> <C-w>j       
nmap <C-k> <C-w>k       
nmap <C-l> <C-w>l       
                        
" vim-pathogen          
execute pathogen#infect()
syntax on               
filetype plugin indent on

" Ctrl-P                
set runtimepath^=~/.vim/bundle/ctrlp.vim
"                                                                 *'g:ctrlp_map'*
" Use this option to change the mapping to invoke CtrlP in |Normal| mode:
let g:ctrlp_map = '<c-p>'
"                                                                 *'g:ctrlp_cmd'*
" Set the default opening command to use when pressing the above mapping:
let g:ctrlp_cmd = 'CtrlP'
"                                                  *'g:ctrlp_working_path_mode'*
" When starting up, CtrlP sets its local working directory according to this
" variable: >        
let g:ctrlp_working_path_mode = 'ra'

set colorcolumn=5,9,13,17,21

" NERDTree settings  
"                    
" Start NERDTree. If a file is specified, move the cursor to its window.
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * NERDTree | if argc() > 0 || exists("s:std_in") | wincmd p | endif

" Open the existing NERDTree on each new tab.
autocmd BufWinEnter * if getcmdwintype() == '' | silent NERDTreeMirror | endif

let NERDTreeWinSize = 20

" toggle between line wrapping and unwrapping
map <C-a> :set wrap!<CR>

" set colorcolumn color
:hi ColorColumn ctermbg=lightgrey guibg=lightgrey

No comments:

Post a Comment