Skip to content

Instantly share code, notes, and snippets.

@anshulguleria
Last active May 12, 2016 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anshulguleria/b922ca8e6f6fbca82c87 to your computer and use it in GitHub Desktop.
Save anshulguleria/b922ca8e6f6fbca82c87 to your computer and use it in GitHub Desktop.
configuration files for my linux setup
{
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true,
"es6": true
},
"ecmaFeatures": {
"blockBindings": true,
"forOf": true,
"templateStrings": true,
"module": true
},
"rules": {
"strict": 0,
"eqeqeq": 1,
"curly": 1,
"quotes": 0,
"no-unused-vars": 1,
"no-dupe-args": 2,
"no-dupe-keys": 2,
"no-redeclare": [2, {"builtinGlobals": true}],
"no-undef": 2
}
}
$include /etc/inputrc
# Add option to ~/.inputrc to enable case-insensitive tab completion
set completion-ignore-case On

This file lists the basic dependencies to be installed.

TODO: change this file to shell file to automatically install dependencies
  • vim
  • vim-plug plugin
  • eslint
  • babel-eslint
  • git-aware-prompt (command: export PS1="${debian_chroot:+($debian_chroot)}[\033[01;32m]\u@\h[\033[00m]:[\033[01;34m]\w[\033[00m] [$txtcyn]$git_branch[$txtred]$git_dirty[$txtrst]$ ")
  • nvm
  • node & npm via nvm
  • fzf (fuzzy search in terminal)
call plug#begin('~/.config/nvim/plugged')
" color schemes
Plug 'mhartington/oceanic-next'
" Status line plugin
Plug 'itchyny/lightline.vim'
" Vim plugin for easy alignment. Visit github site for more info.
Plug 'junegunn/vim-easy-align'
" On-demand loading on some event.
" Vim plugin to show directory structure.
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
" Plugin outside ~/.config/nvim/plugged with post-update hook
" Fuzzy search plugin fzf
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
" Syntax highlighting for javascript
Plug 'othree/yajs.vim'
" Plugin for jsdoc auto-snippets
Plug 'heavenshell/vim-jsdoc'
" Syntax checking plugin for asynchronous functionality
Plug 'benekastah/neomake'
" Emmet coding
Plug 'mattn/emmet-vim'
" Show git diff integrationa and add/remove highlight
Plug 'airblade/vim-gitgutter'
" Babel plugin and as plugin suggests
" we are installing webapi also
Plug 'jbgutierrez/vim-babel'
Plug 'mattn/webapi-vim'
" Plugin for dev icons for vim
Plug 'ryanoasis/vim-devicons'
call plug#end()
" fzf mapping to Ctrl-p like
" Ctrl-p plugin
noremap <C-p> :FZF<CR>
" NERDTree settings
let g:NERDTreeWinPos = "right"
" jsdoc settings
let g:jsdoc_access_descriptions = 2
let g:jsdoc_underscore_private = 1
let g:jsdoc_enable_es6 = 1
" neomake settings
autocmd! BufWritePost * Neomake
" Set linter to eslint
let g:neomake_javascript_enabled_markers = ['eslint']
let g:neomake_open_list = 2
" Any extra args required to be passed to command
"let g:neomake_javascript_eslint_marker
" Settings for dev-icons
set encoding=utf8
set guifont=Meslo\ LG\ M\ Regular\ for\ Powerline\ Nerd\ Font\ Complete\ Mono\ 11
" lightline settings
let g:lightline = {
\ 'colorscheme': 'wombat',
\ 'component': {
\ 'readonly': '%{&readonly?"":""}',
\ },
\ 'separator': { 'left': '', 'right': '' },
\ 'subseparator': { 'left': '', 'right': '' }
\}
" Theme settings
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
colorscheme OceanicNext
set background=dark
" Set case insensitive search for autosuggest
" and other commands
set ignorecase
" Set smartcase on which check for capital letters for
" direct match rather than case insensitive
set smartcase
" Set line numbers to be visible
set number
" Set cursor line highlight
set cursorline
hi CursorLine term=bold cterm=bold gui=bold
" END
" Indentation settings
" size of hard tabstop
set tabstop=4
" size of indent
set shiftwidth=4
" A combination of spaces and tabs are used to simulate
" tab stops at a width other than (hard) tabstop
set softtabstop=4
" Always uses spaces instead of tab character
set expandtab
" Folding settings
set foldmethod=indent " fold based on indent
set foldnestmax=10 " deepest fold is 10 levels
set nofoldenable " don't fold by default
set foldlevel=1
" WHITESPACE CONFIGURATION
" ----------------------------------
" highlight extra whitespaces
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
" auto-strip white spaces on save
function! TrimWhiteSpace()
%s/\s\+$//e
endfunction
autocmd BufWritePre * :call TrimWhiteSpace()
" ENDS
# Set a Ctrl-b shortcut for reloading your tmux config
bind r source-file ~/.tmux.conf
# Set XTerm key bindings
setw -g xterm-keys on
# Use vim bindings
setw -g mode-keys vi
# Rename your terminals
set -g set-titles on
set -g set-titles-string '#(whoami)::#h::#(curl ipecho.net/plain;echo)'
# Status bar customization
set -g status-bg black
set -g status-fg white
set -g status-interval 5
set -g status-left-length 90
set -g status-right-length 60
set -g status-left "#[fg=green]#(whoami)#[fg=white]:: #[fg=blue]#(hostname -s)#[fg=white]::#[fg=yellow]#(curl ipecho.net/plain;echo)"
set -g status-justify left
set -g status-right '#[fg=Cyan]#S #[fg=white]%a %d %b %R'
# terminal color
set -g default-terminal "screen-256color"
set -g terminal-overrides "xterm-256color:Tc"
# remove delay in using esc key
set -s escape-time 0
# Remap window navigation to vim
unbind-key j
bind-key j select-pane -D
unbind-key k
bind-key k select-pane -U
unbind-key h
bind-key h select-pane -L
unbind-key l
bind-key l select-pane -R
call plug#begin('~/.vim/plugged')
" Make sure you use single quotes
Plug 'junegunn/seoul256.vim'
Plug 'morhetz/gruvbox'
" Colorscheme dracula
Plug 'zenorocha/dracula-theme', {'rtp': 'vim/'}
" On-demand loading
" nerdtree plugin
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
" syntax checker for js
Plug 'scrooloose/syntastic'
" vim-javascript
Plug 'pangloss/vim-javascript'
" vim-jsdoc
Plug 'heavenshell/vim-jsdoc'
" Ctrl p fuzzy file searching
Plug 'ctrlpvim/ctrlp.vim'
" emmet coding
Plug 'mattn/emmet-vim'
" plugin git-gutter git add/remoe hightlighting
Plug 'airblade/vim-gitgutter'
" Babel plugin
Plug 'jbgutierrez/vim-babel'
Plug 'mattn/webapi-vim'
" plugin for quich movement in vim like 'f' key in vimium
Plug 'easymotion/vim-easymotion'
" Plugin for dev icons
Plug 'ryanoasis/vim-devicons'
call plug#end()
if !has('nvim')
" enable 24 bit color for nvim
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
else
" enable 256 colors in vim
set t_Co=256
endif
" set darkbackground
set background=dark
" other settings
" set color scheme
"colorscheme seoul256
colorscheme gruvbox
" managing searches
set ignorecase
set smartcase
set incsearch
set hlsearch
" handling tabspacing
" size of a hard tabstop
set tabstop=4
" size of an "indent"
set shiftwidth=4
" a combination of spaces and tabs are used to simulate tab stops at a width
" other than the (hard)tabstop
set softtabstop=4
" make "tab" insert indents instead of tabs at the beginning of a line
set smarttab
" always uses spaces instead of tab characters
set expandtab
" set line numbers to be visible
set number
" enable statusline
set laststatus=2
" setting overflow margin visible
"set colorcolumn=80
" Nerdtree settings
let g:NERDTreeWinPos = "right"
" jsdoc settings
let g:jsdoc_access_descriptions = 2
let g:jsdoc_underscore_private = 1
let g:jsdoc_enable_es6 = 1
" status line settings for syntastic
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_error_symbol = "✗"
let g:syntastic_warning_symbol = "⚠"
let g:syntastic_java_checkers=['javac']
let g:syntastic_javascript_checkers=['eslint']
let g:syntastic_python_checkers=['flake8', 'pylint']
" configuration for easymotion
" Turn on case insensitive feature
let g:EasyMotion_smartcase = 1
" `s{char}{char}{label}`
" Need one more keystroke, but on average, it may be more comfortable.
nmap s <Plug>(easymotion-overwin-f2)
" easymotion configuration ends
" WHITESPACE CONFIGURATION
" ----------------------------------
" highlight extra whitespaces
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
" auto-strip white spaces on save
function! TrimWhiteSpace()
%s/\s\+$//e
endfunction
autocmd BufWritePre * :call TrimWhiteSpace()
" ENDS
" highlight current line
set cursorline
hi CursorLine term=bold cterm=bold guibg=darkred
" ENDS
" folding settings
set foldmethod=indent " fold based on indent
set foldnestmax=10 " deepest fold is 10 levels
set nofoldenable " don't fold by default
set foldlevel=1 " trying this setting
" ENDS
" Handle modelines
set nocompatible
set modelines=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment