Skip to content

Instantly share code, notes, and snippets.

@adminy
Created May 28, 2021 12:06
Show Gist options
  • Save adminy/349584d2b235c6458b70b2bc9da6cd7c to your computer and use it in GitHub Desktop.
Save adminy/349584d2b235c6458b70b2bc9da6cd7c to your computer and use it in GitHub Desktop.
"start
set number "set relativenumber
nmap <c-x> :wq<CR>
imap <c-x> <Esc>:wq<CR>a
set whichwrap+=<,>,h,l,[,]
syntax on
map <C-n> :NERDTreeToggle<CR>
"
call plug#begin('~/.vim/plugged')
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'vim-airline/vim-airline' "Theme
"Plug 'neoclide/coc.nvim', {'do': { -> coc#util#install()}} "JS Check
Plug 'leafgarland/typescript-vim' "JS Autocomplete
Plug 'tomasiser/vim-code-dark' "Theme
Plug 'scrooloose/nerdtree' "Files Tree
"Plug 'dense-analysis/ale' "Linter
Plug 'tpope/vim-fugitive'
Plug 'sheerun/vim-polyglot'
Plug 'itchyny/lightline.vim'
Plug 'wakatime/vim-wakatime'
call plug#end()
" Powerline
let g:airline_powerline_fonts = 1
" Theming
let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'
"set background=dark
"set termguicolors
"let ayucolor="mirage"
"colorscheme ayu
"let g:airline_theme="ayu"
colorscheme codedark
let g:airline_theme = 'codedark'
" Set this. Airline will handle the rest.
let g:airline#extensions#ale#enabled = 1
let g:ale_sign_column_always = 1
let g:ale_sign_error = '>>'
let g:ale_sign_warning = '--'
" Keybindings
" move selected lines up one line
xnoremap <c-minus> :m-2<CR>
" move selected lines down one line
xnoremap <c-plus> :m'>+<CR>
" CTRL-C to copy (visual mode)
vmap <C-c> y
" CTRL-X to cut (visual mode)
vmap <C-x> x
" CTRL-V to paste (insert mode)
imap <C-v> <esc>P
" fuzzy find files in the working directory (where you launched Vim from)
nmap <leader>f :Files<cr>
" fuzzy find lines in the current file
nmap <leader>/ :BLines<cr>
" fuzzy find an open buffer
nmap <leader>b :Buffers<cr>
" fuzzy find text in the working directory
nmap <leader>r :Rg
" fuzzy find Vim commands (like Ctrl-Shift-P in Sublime/Atom/VSC)
nmap <leader>c :Commands<cr>
"" Typescript
"autocmd FileType typescript nnoremap <buffer><silent> <F12> :call CocAction("jumpDefinition")<cr>
"autocmd FileType typescript nnoremap <buffer><silent> <S-F12> :call CocAction("jumpReferences")<cr>
"autocmd FileType typescript nnoremap <buffer><silent> <F2> :call CocAction("rename")<cr>
"autocmd FileType typescript nnoremap <buffer><silent> <leader>i :call CocAction("doHover")<cr>
"autocmd FileType typescript nnoremap <buffer><silent> <leader>I :call CocAction("showSignatureHelp")<cr>
"autocmd FileType typescript nnoremap <buffer><silent> <leader>F :call CocAction("format")<cr>
"autocmd FileType typescript vnoremap <buffer><silent> <leader>F :call CocAction("formatSelected")<cr>
"autocmd FileType typescript nnoremap <buffer><silent> <leader>. :call CocAction("codeAction")<cr>
"autocmd vimenter * NERDTree
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
map , GA<enter>
set foldmethod=indent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment