From ce80b815161b6fafff8fc96033c52d36085ad726 Mon Sep 17 00:00:00 2001 From: Sonny Date: Thu, 14 Jun 2018 22:42:54 +0200 Subject: [PATCH 1/4] Remove unneeded if loops --- tmux/.tmux.conf | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index c8ebb29..0150847 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -1,22 +1,11 @@ # use vim copy/paste keybindings setw -g mode-keys vi -# needs xclip for system clipboard -run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | cut -c 6-)" -if-shell -b '[ "$(echo "$TMUX_VERSION < 2.4" | bc)" = 1 ]' \ - "bind-key Escape copy-mode; \ - bind-key -t vi-copy Escape cancel; \ - bind-key p paste-buffer; \ - bind-key -t vi-copy v begin-selection; \ - bind-key -t vi-copy V select-line; \ - bind-key -t vi-copy r rectangle-toggle; \ - bind -t vi-copy y copy-pipe 'xclip -in -selection clipboard'" +# Copy vim-style to clipboard +bind -t vi-copy y copy-pipe "xclip -sel clip -i" -if-shell -b '[ "$(echo "$TMUX_VERSION >= 2.4" | bc)" = 1 ]' \ - "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; \ - bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'" +# Paste clipboard into window +bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer" # split panes using | and - bind | split-window -h @@ -54,6 +43,3 @@ setw -g window-status-format ' #I#[fg=colour0] #[fg=colour0]#W ' set -g history-limit 10000 set -g mouse on - -# terminal colors - From 7be04bfc63658fb5c19f074b0668ed68ee70c2bb Mon Sep 17 00:00:00 2001 From: Sonny Date: Mon, 2 Jul 2018 14:24:56 +0200 Subject: [PATCH 2/4] Color trailing spaces --- vim/.vimrc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vim/.vimrc b/vim/.vimrc index 537920c..3e5571f 100755 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -40,6 +40,13 @@ if exists('+termguicolors') colorscheme breezy endif +" Color trailing spaces with red color +highlight ExtraWhitespace ctermbg=red guibg=red +match ExtraWhitespace /\s\+$/ +autocmd BufWinEnter * match ExtraWhitespace /\s\+$/ +autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@ Date: Sun, 15 Jul 2018 14:57:31 +0200 Subject: [PATCH 3/4] Add yaml formatting --- tmux/.tmux.conf | 6 ------ vim/.vimrc | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 0150847..1b56817 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -1,12 +1,6 @@ # use vim copy/paste keybindings setw -g mode-keys vi -# Copy vim-style to clipboard -bind -t vi-copy y copy-pipe "xclip -sel clip -i" - -# Paste clipboard into window -bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer" - # split panes using | and - bind | split-window -h bind - split-window -v diff --git a/vim/.vimrc b/vim/.vimrc index 3e5571f..cb85334 100755 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -19,7 +19,7 @@ set hidden " file specific formatting autocmd Filetype python,bash,sh,java,php setlocal tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent fileformat=unix -autocmd Filetype css,html,htmldjango,javascript setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab autoindent +autocmd Filetype css,html,htmldjango,javascript,yaml setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab autoindent " search down into subfolders " provides tab-completion for all file-related tasks From eb12ff932825b643ab7ff97d835a9c850055e966 Mon Sep 17 00:00:00 2001 From: Sonny Date: Mon, 16 Jul 2018 21:44:00 +0200 Subject: [PATCH 4/4] Add json to indent formatting --- tmux/.tmux.conf | 5 ----- vim/.vimrc | 7 ++----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 1b56817..9d11b72 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -7,16 +7,11 @@ bind - split-window -v unbind '"' 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 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 set-window-option -g status-left '#[fg=colour0,bg=colour102,bold] #S ' diff --git a/vim/.vimrc b/vim/.vimrc index cb85334..81421cd 100755 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -18,7 +18,7 @@ syntax on set hidden " file specific formatting -autocmd Filetype python,bash,sh,java,php setlocal tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent fileformat=unix +autocmd Filetype python,bash,sh,java,php,json setlocal tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent fileformat=unix autocmd Filetype css,html,htmldjango,javascript,yaml setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab autoindent " search down into subfolders @@ -31,9 +31,6 @@ set wildmenu " use normal backspace behavior set backspace=2 -set t_ut= -set t_Co=256 - " colorscheme if exists('+termguicolors') set termguicolors @@ -41,7 +38,7 @@ if exists('+termguicolors') endif " Color trailing spaces with red color -highlight ExtraWhitespace ctermbg=red guibg=red +highlight ExtraWhitespace ctermbg=green guibg=green match ExtraWhitespace /\s\+$/ autocmd BufWinEnter * match ExtraWhitespace /\s\+$/ autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@