Merge branch 'jidbo-master'

This commit is contained in:
saibotk 2019-01-19 12:16:57 +01:00
commit 632e75afc3
4 changed files with 93 additions and 52 deletions

120
.vimrc
View file

@ -1,9 +1,3 @@
" if empty(glob("~/.vim/bundle/Vundle.vim"))
" silent !git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
" autocmd GUIEnter * PluginInstall
" \ source ~/.vimrc
" endif
set nocompatible " required
filetype off " required
@ -17,49 +11,52 @@ Plugin 'gmarik/Vundle.vim'
" add all your plugins here (note older versions of Vundle
" used Bundle instead of Plugin)
" Simply Fold
Plugin 'tmhedberg/SimpylFold'
" USEFUL
" comment plugin
Plugin 'tpope/vim-commentary'
" autodindent python
Plugin 'vim-scripts/indentpython.vim'
" close xml/html tags
Plugin 'docunext/closetag.vim'
" syntax highlighting
Plugin 'vim-syntastic/syntastic'
" pep8 checking
Plugin 'nvie/vim-flake8'
" jedi-vim
Plugin 'davidhalter/jedi-vim'
" WINDOW MANAGEMENT
" tmux navigator
Plugin 'christoomey/vim-tmux-navigator'
" winresizer
Plugin 'simeji/winresizer'
" search for files
Plugin 'ctrlpvim/ctrlp.vim'
" color schemes
Plugin 'flazz/vim-colorschemes'
" FILE MANAGEMENT
" nert-tree
Plugin 'scrooloose/nerdtree'
" nerd-commenter
Plugin 'scrooloose/nerdcommenter'
" fzf plugin
Plugin 'junegunn/fzf.vim'
" GIT STUFF
" git
Plugin 'tpope/vim-fugitive'
" surround blocks
Plugin 'tpope/vim-surround'
" vim gitgutter
Plugin 'airblade/vim-gitgutter'
" latex
Plugin 'lervag/vimtex'
" COLORS
" color schemes
Plugin 'flazz/vim-colorschemes'
" powerline
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
" LANGUAGE SUPPORT
" vim ale for interaction with language servers
Plugin 'w0rp/ale'
" language packs
Plugin 'sheerun/vim-polyglot'
" latex
Plugin 'lervag/vimtex'
" promela syntax highlighting
Plugin 'vim-scripts/promela.vim'
@ -70,8 +67,6 @@ filetype plugin indent on " required
" syntax
syntax on
colorscheme Benokai
let g:airline_theme='luna'
let python_highlight_all=1
let mapleader=" "
" random settings
@ -84,6 +79,7 @@ set virtualedit=block
set scrolloff=1
set wildmenu
set term=screen-256color
set autoread
" tabs and line wrap
set tabstop=4
@ -100,6 +96,11 @@ set incsearch
set hlsearch
set smartcase
" Disable Backup and Swap files
set noswapfile
set nobackup
set nowritebackup
" setup split
set splitbelow
set splitright
@ -112,15 +113,15 @@ nnoremap <leader>h <C-W><C-H>
" tabs
nnoremap <leader>t :tabnew<CR>
nnoremap <leader>u gT
nnoremap <leader>i gt
nnoremap <C-n> gT
nnoremap <C-p> gt
" Enable folding
set foldmethod=indent
set foldlevel=99
" remap code folding
nnoremap <leader>f za
nnoremap <leader>g za
" html css js indents
au BufNewFile,BufRead *.js, *.html, *.css
@ -131,22 +132,41 @@ au BufNewFile,BufRead *.js, *.html, *.css
" PLUGIN SETTINGS
" nerd tree setup
let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
map <leader>n :NERDTreeToggle<CR>
map <leader>e :NERDTreeToggle<CR>
" ctrl-p setup
let g:ctrlp_working_path_mode = 'ra'
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/](\.(git|hg|svn))?(venv)?$',
\ 'file': '\v\.(exe|so|dll)$',
\ 'link': 'some_bad_symbolic_links',
\ }
" see docstrings for folded code
let g:SimpylFold_docstring_preview=1
" airline tabs
" airline setup
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#formatter = 'unique_tail_improved'
let g:airline_theme='solarized'
let g:airline_solarized_bg='dark'
let g:airline_powerline_fonts = 1
" nerd-commenter setup
let g:NERDSpaceDelims = 1
" gitgutter setup
let g:gitgutter_sign_added = '∙'
let g:gitgutter_sign_modified = '∙'
let g:gitgutter_sign_removed = '∙'
let g:gitgutter_sign_modified_removed = '∙'
nmap ]g :GitGutterNextHunk<CR>
nmap [g :GitGutterPrevHunk<CR>
augroup VimDiff
autocmd!
autocmd VimEnter,FilterWritePre * if &diff | GitGutterDisable | endif
augroup END
" fzf setup
nmap <C-z> :Buffers<CR>
nmap <Leader>f :Files<CR>
let g:fzf_buffers_jump = 1
" vim-ale setup
let g:ale_completion_enabled = 1
let g:ale_lint_on_text_changed = 'never'
let g:ale_fixers = {
\ '*': ['trim_whitespace'],
\ 'python': ['autopep8']
\ }
nmap <Leader>d :ALEGoToDefinition<CR>
nmap <Leader>r :ALEFindReferences<CR>
nmap <Leader>b :ALEFix<CR>
nnoremap <space>l :lnext<CR>
nnoremap <space>p :lprevious<CR>

12
.zshrc
View file

@ -6,7 +6,7 @@ export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="agnoster"
ZSH_THEME="robbyrussell"
# Set list of themes to load
# Setting this variable when ZSH_THEME=random
@ -66,6 +66,7 @@ plugins=(
dirhistory
gradle
per-directory-history
fzf
)
source $ZSH/oh-my-zsh.sh
@ -90,6 +91,9 @@ source $ZSH/oh-my-zsh.sh
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
# Set vim as default editor
export EDITOR='vim'
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
@ -110,6 +114,12 @@ alias la='ls -la'
if [ -f ~/.dotfiles/.localcommands ]; then
source ~/.dotfiles/.localcommands
fi
# Tmuxinator autocomplete
if [ -f ~/.bin/tmuxinator.zsh ]; then
source ~/.bin/tmuxinator.zsh
fi
export PATH="$PATH:$(ruby -e 'print Gem.user_dir')/bin"
# Tmuxinator autocomplete
if [ -f ~/.bin/tmuxinator.zsh ]; then

View file

@ -28,6 +28,7 @@ ln -s ~/.dotfiles/.vim ~/.vim
ln -s ~/.dotfiles/tmux.conf ~/.tmux.conf
ln -s ~/.dotfiles/.atom ~/.atom
# install vundle
if ! [ -d ~/.vim/bundle/Vundle.vim ]; then
echo '[INFO] Installing Vundle...'

View file

@ -2,6 +2,16 @@
# set vi keys
set-window-option -g mode-keys vi
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -T copy-mode-vi C-h select-pane -L
bind-key -T copy-mode-vi C-j select-pane -D
bind-key -T copy-mode-vi C-k select-pane -U
bind-key -T copy-mode-vi C-l select-pane -R
# default statusbar colors
set-option -g status-bg black #base02