my minimal VIM setup. Now experiment with nvim
" ===========================================
" >> AUTHOR : https://github.com/ervinismu <<
" ===========================================
" ===========
" >> BASIC <<
" ===========
" Turn on auto indent when paste, to avoid unexpected effect
set paste
" Show the filename in the window titlebar
set title
" enable hybrid line number
set number relativenumber
" Show “invisible” characters
set lcs=tab:▸\ ,trail:·,nbsp:_
set list
" Highlight current line horizontally
set cursorline
" Highlight cursor line vertically
set cursorcolumn
" highlight search
set hlsearch
" Highlight dynamically as pattern is typed
set incsearch
" Enable mouse
set mouse=a
" Enable syntax highlight
syntax on
" option will copy your current indentation when creating a new line
set copyindent
set softtabstop=0
set shiftwidth=4
set tabstop=4
set expandtab
" Set encoding
set encoding=utf8
" airline font
let g:airline_powerline_fonts = 1
" vim-go config
let g:go_def_mode='gopls'
let g:go_info_mode='gopls'
" ==============
" >> NERDTree <<
" ==============
" Open FZF Prompt using Ctrl + f
nnoremap <silent> <expr> <c-f> (expand('%') =~ 'NERD_tree' ? "\<c-w>\<c-w>" : '').":FZF \<cr>"
" Enable tab split when search file using FZF
let g:fzf_action = { 'enter': 'tab split' }
" Toggle nerdtree nav using Ctrl + n
nnoremap <C-n> :NERDTreeToggle<CR>
" CATPUCCIN
" This is only necessary if you use "set termguicolors".
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
" fixes glitch? in colors when using vim with tmux
set background=dark
set t_Co=256
set termguicolors
let g:airline_theme = 'catppuccin_mocha'
colorscheme sorbet
" ==============
" >> VIM-Plug <<
" ==============
call plug#begin()
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'preservim/nerdtree'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'ryanoasis/vim-devicons'
Plug 'catppuccin/vim', { 'as': 'catppuccin' }
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}
call plug#end()
" NOTE :
" vim-devicons : may be broken if you dont set Droidsans font. reference -> https://github.com/ryanoasis/vim-devicons/wiki/Installation#set-font
" if you dont use GuiVim, change your terminal font using droidSansMono or hackNerd
" =================
" >> VISUAL MODE <<
" =================
" copy to system clipboard with Ctrl + y
vnoremap <C-y> :w !pbcopy<CR><CR>
" disable arrow button - you can comment this(L10 - L13) if you want to use arrow keyboard
vnoremap <Left> :echo "No Left, you can do it!"<CR>
vnoremap <Right> :echo "No Right, you can do it!"<CR>
vnoremap <Up> :echo "No Up, you can do it!"<CR>
vnoremap <Down> :echo "No Down, you can do it!"<CR>
" =================
" >> NORMAL MODE <<
" =================
" paste from systemclipboard with Ctrl + p
nnoremap <C-p> :r !pbpaste<CR>
" disable arrow button - you can comment this(L10 - L13) if you want to use arrow keyboard
nnoremap <Left> :echo "No Left, you can do it!"<CR>
nnoremap <Right> :echo "No Right, you can do it!"<CR>
nnoremap <Up> :echo "No Up, you can do it!"<CR>
nnoremap <Down> :echo "No Down, you can do it!"<CR>