Skip to content

Instantly share code, notes, and snippets.

@musleh0001
Last active July 21, 2022 17:35
Show Gist options
  • Save musleh0001/6915910e9376a29fbfac8e5a2bea19db to your computer and use it in GitHub Desktop.
Save musleh0001/6915910e9376a29fbfac8e5a2bea19db to your computer and use it in GitHub Desktop.
vim command

*********** Vim Config **********

call plug#begin('~/.vim/plugged')

Plug 'tomasiser/vim-code-dark'
Plug 'pangloss/vim-javascript'
Plug 'scrooloose/nerdtree'
Plug 'morhetz/gruvbox'
Plug 'leafgarland/typescript-vim'
Plug 'peitalin/vim-jsx-typescript'
Plug 'jparise/vim-graphql'
Plug 'Skanehira/docker-compose.vim'
Plug 'tpope/vim-commentary'
Plug 'vim-scripts/AutoComplPop'

Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'ryanoasis/vim-devicons'

call plug#end()

let g:airline_theme='simple'

autocmd BufEnter *.{js,jsx,ts,tsx} :syntax sync fromstart
autocmd BufLeave *.{js,jsx,ts,tsx} :syntax sync clear

colorscheme gruvbox
set background=dark

inoremap jj <Esc>

syntax on

set number
set incsearch
set belloff=all
set complete+=kspell
set completeopt=menuone,longest
set shortmess+=c
 
nmap <C-f> :NERDTreeToggle<CR>
vmap ++ <plug>NERDCommenterToggle
nmap ++ <plug>NERDCommenterToggle
nmap <C-t> :below terminal<CR>
   
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
  
nnorema <leader>h :split<Space>
nnoremap <leader>v :vsplit<Space>

******* Basic key binding *********

o --> Open file t --> Open file in new tab gt --> go to next tab i --> split file s --> vsplit file

m+a --> create new file :!touch <filename.ext> --> another way of create file :!mkdir --> another way of delete file

m+d --> delete file

Ctrl + w + w --> change window

:e file.txt --> open file

Delete in range :(from),(to)d

Delete from current line to end :.,$d

Delete from current line to beginning :dgg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment