Skip to content

Instantly share code, notes, and snippets.

@sharavsambuu
Last active November 13, 2023 03:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sharavsambuu/db6278c07e5ab7982af754185bed946e to your computer and use it in GitHub Desktop.
Save sharavsambuu/db6278c07e5ab7982af754185bed946e to your computer and use it in GitHub Desktop.
my .vimrc
call plug#begin('~/.vim/plugged')
Plug 'junegunn/vim-easy-align'
Plug 'https://github.com/junegunn/vim-github-dashboard.git'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'derekwyatt/vim-scala'
Plug 'flazz/vim-colorschemes'
Plug 'morhetz/gruvbox'
Plug 'othree/yajs.vim'
Plug 'mustache/vim-mustache-handlebars'
Plug 'elubow/cql-vim'
Plug 'othree/es.next.syntax.vim'
Plug 'rust-lang/rust.vim'
Plug 'HerringtonDarkholme/yats.vim'
Plug 'rudes/vim-java'
Plug 'pangloss/vim-javascript'
Plug 'leafgarland/typescript-vim'
Plug 'maxmellon/vim-jsx-pretty'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'leshill/vim-json'
Plug 'tpope/vim-fugitive' "git integration
Plug 'scrooloose/syntastic' "code syntaxis
Plug 'Raimondi/delimitMate' "automatic closing of quotes, parenthesis...
Plug 'yggdroot/indentline' "Show indent lines (useful for loops)
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'ervandew/supertab' "<Tab> for code completion
Plug 'ctrlpvim/ctrlp.vim' "Finder for vim
Plug 'manicmaniac/coconut.vim'
Plug 'rbong/vim-crystalline'
Plug 'udalov/kotlin-vim'
Plug 'nelsyeung/twig.vim'
Plug 'junegunn/fzf', { 'do': './install --bin' }
Plug 'junegunn/fzf.vim'
Plug 'stanangeloff/php.vim'
Plug 'JuliaEditorSupport/julia-vim'
Plug 'francoiscabrol/ranger.vim'
call plug#end()
" configurations
let mapleader = "\<Space>"
" map <mapleader>d :NERDTreeToggle<CR>
nmap <F4> :NERDTreeToggle<cr>
map <C-n> :NERDTreeToggle<CR>
nnoremap <Leader>d :NERDTreeToggle<CR>
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l
"gruvbox
set background=dark " Setting dark mode
"set background=light " Setting light mode
nnoremap <silent> [oh :call gruvbox#hls_show()<CR>
nnoremap <silent> ]oh :call gruvbox#hls_hide()<CR>
nnoremap <silent> coh :call gruvbox#hls_toggle()<CR>
nnoremap * :let @/ = ""<CR>:call gruvbox#hls_show()<CR>*
nnoremap / :let @/ = ""<CR>:call gruvbox#hls_show()<CR>/
nnoremap ? :let @/ = ""<CR>:call gruvbox#hls_show()<CR>?
colorscheme gruvbox
let g:javascript_plugin_flow = 1
let g:jsx_ext_required = 0
" for ember-cli
set backupdir=~/.vim/backup//
set directory=~/.vim/swap//
set undodir=~/.vim/undo//
" crystal line
"let g:crystalline_theme = 'default'
"set laststatus=2
"
" Basic VIM settings
" - https://github.com/amix/vimrc/blob/master/vimrcs/basic.vim
" Use spaces instead of tabs
set tabstop =4
set softtabstop=4
set shiftwidth =4
set expandtab
"other type of files"
autocmd FileType javascript setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType typescript setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType html setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType html.handlebars setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType hbs setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType scss setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType css setlocal shiftwidth=2 tabstop=2 softtabstop=2
" hide pyc files
let NERDTreeIgnore = ['\.pyc$']
" Source : https://raw.githubusercontent.com/j1z0/vim-config/master/vimrc
"------------Start Python PEP 8 stuff----------------
" Number of spaces that a pre-existing tab is equal to.
au BufRead,BufNewFile *py,*pyw,*.c,*.h set tabstop=4
"spaces for indents
au BufRead,BufNewFile *.py,*pyw set shiftwidth=4
au BufRead,BufNewFile *.py,*.pyw set expandtab
au BufRead,BufNewFile *.py set softtabstop=4
" Use the below highlight group when displaying bad whitespace is desired.
highlight BadWhitespace ctermbg=red guibg=red
" Display tabs at the beginning of a line in Python mode as bad.
au BufRead,BufNewFile *.py,*.pyw match BadWhitespace /^\t\+/
" Make trailing whitespace be flagged as bad.
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
" Wrap text after a certain number of characters
au BufRead,BufNewFile *.py,*.pyw, set textwidth=100
" Use UNIX (\n) line endings.
au BufNewFile *.py,*.pyw,*.c,*.h set fileformat=unix
" Set the default file encoding to UTF-8:
set encoding=utf-8
" For full syntax highlighting:
let python_highlight_all=1
syntax on
" Keep indentation level from previous line:
autocmd FileType python set autoindent
" make backspaces more powerfull
set backspace=indent,eol,start
"Folding based on indentation:
"autocmd FileType python set foldmethod=indent
"use space to open folds
"nnoremap <space> za
"----------Stop python PEP 8 stuff--------------
set nu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment