Tmux vim copy/paste & vim python settings

This commit is contained in:
Sonny Bakker 2017-10-21 21:49:09 +02:00
parent fa63e29e5d
commit 3bfd97c7b0
3 changed files with 1465 additions and 61 deletions

View file

@ -1,8 +1,14 @@
# split panes using | and -
# use vim copy/paste keybindings
setw -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection # Begin selection in copy mode.
bind-key -T copy-mode-vi 'C-v' send -X rectangle-toggle # Begin selection in copy mode.
bind-key -T copy-mode-vi 'y' send -X copy-selection # Yank selection in copy mode.
# needs tmux 2.4
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'V' send -X select-line
bind-key -T copy-mode-vi 'r' send -X rectangle-toggle
# needs xclip for system clipboard
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "xclip -in -selection clipboard"
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
@ -11,33 +17,33 @@ unbind %
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf
## Status bar design
set -g status-position bottom
# status bar design
set -g status-position top
set -g status-bg colour239
set -g status-attr dim
set -g status-right ' #[fg=colour233,bg=colour102,bold] #(hostname) #[fg=colour233,bg=colour102,bold] %d/%m #[fg=colour233,bg=colour102,bold] %H:%M:%S '
set -g status-right-length 50
set -g status-left-length 20
# Current session name
# current session name
set-window-option -g status-left '#[fg=colour0,bg=colour102,bold] #S '
# Current window
# current window
setw -g window-status-current-fg colour0
setw -g window-status-current-bg colour102
setw -g window-status-current-attr bold
setw -g window-status-current-format ' #I#[fg=colour0] #[fg=colour0]#W '
# Background windows
# background windows
setw -g window-status-fg colour0
setw -g window-status-bg colour240
setw -g window-status-format ' #I#[fg=colour0] #[fg=colour0]#W '
# Scrollback history
# scrollback history
set -g mouse on
# Terminal colors
# terminal colors
set -g default-terminal "xterm-256color"
set-option -ga update-environment "DISPLAY SSH_ASKPASS SSH_AGENT_PID \

View file

@ -1,82 +1,86 @@
"Indent depending on filetype
filetype plugin on
" indent depending on filetype
filetype on
set autoindent
filetype indent on
"Fix different locale settings when ssh'ing
" fix different locale settings when ssh'ing
set encoding=utf-8
"syntax on
syntax enable
" syntax on
syntax on
"4 spaces instead of tabs
set tabstop=4 shiftwidth=4 softtabstop=4 expandtab
" remove trailing spaces on save
autocmd BufWritePre * :%s/\s\+$//e
" Fold methods based on indents
" make vim save and load the folding of the document each time it loads
" also places the cursor in the last place that it was left
" python specific settings
au BufWinLeave *.py mkview
au BufWinEnter *.py silent loadview
au BufNewFile,BufRead *.py;
\ set tabstop=4
\ set softtabstop=4
\ set shiftwidth=4
\ set textwidth=79
\ set expandtab
\ set autoindent
\ set fileformat=unix
" fold methods based on indents
" zo to open folds, zc to close
set foldmethod=indent
set foldlevel=20
" Search down into subfolders
" Provides tab-completion for all file-related tasks
" search down into subfolders
" provides tab-completion for all file-related tasks
set path+=**
" Display all matching files when we tab complete
" display all matching files when we tab complete
set wildmenu
" use normal backspace behavior
set backspace=2
" disable background color erase
set t_ut=
" colorscheme
colorscheme despacio
"Automatically source vimrc on save.
" automatically source vimrc on save.
autocmd! bufwritepost $MYVIMRC source $MYVIMRC
"Line numbers
" line numbers
set number
"Changes to current directory when creating new files
" changes to current directory when creating new files
set autochdir
"Higlhight search
" higlhight search
set hls
"Search as characters are entered
" search as characters are entered
set incsearch
"Line for linewrapping
" line for linewrapping
set colorcolumn=80
"Remove temporary swap file
" remove temporary swap file
set nobackup
set noswapfile
"Wrap text instead of being on one line
" wrap text instead of being on one line
set lbr
"Default Colors for CursorLine
" default Colors for CursorLine
set cursorline
highlight CursorLine cterm=none
"Activate statusbar
" activate statusbar
set laststatus=2
set statusline=\ %F\ %m%r%w\ %=\ %{hostname()}\ \ \ %{strlen(&ft)?&ft:'none'}\ %{(&bomb?\",BOM\":\"\")}\ %{&ff}\ \ %l/%L\ \ %c\ %P
"Remove trailing spaces on save
autocmd BufWritePre * :%s/\s\+$//e
"Make vim save and load the folding of the document each time it loads
"Also places the cursor in the last place that it was left
au BufWinLeave *.py mkview
au BufWinEnter *.py silent loadview
"Use pylint for python files (:make % for current file, :make * for all
"files in current directory
autocmd FileType python compiler pylint
"Netrw options
" netrw options
function! ToggleVExplorer()
if exists("t:expl_buf_num")
let expl_win_num = bufwinnr(t:expl_buf_num)
@ -96,24 +100,13 @@ function! ToggleVExplorer()
endif
endfunction
" netrw settings
let g:netrw_banner = 0
let g:netrw_winsize = -30
let g:netrw_browse_split = 4
let g:netrw_liststyle = 3
" ------------ Keybindings ----------------
"Paste mode toggle
set pastetoggle=<F2>
"Reload file
map <F5> :e <CR>
"Open netrw browser
map <silent> <C-E> :call ToggleVExplorer()<CR>
"Open quickfix window
map <F3> :copen <CR>
" tab autocompletion
function! Tab_Or_Complete()
if col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w'
return "\<C-N>"
@ -122,4 +115,15 @@ function! Tab_Or_Complete()
endif
endfunction
" ------------ Keybindings ----------------
" paste mode toggle
set pastetoggle=<F2>
" reload file
map <F5> :e <CR>
" open netrw browser
map <silent> <C-E> :call ToggleVExplorer()<CR>
" tab for completion
inoremap <Tab> <C-R>=Tab_Or_Complete()<CR>

1394
vim/colors/gruvbox.vim Normal file

File diff suppressed because it is too large Load diff