Skip to content

Commit

Permalink
Use moar tabs in vim
Browse files Browse the repository at this point in the history
  • Loading branch information
kmille committed Dec 25, 2020
1 parent bbcb353 commit 95b0106
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 66 deletions.
11 changes: 9 additions & 2 deletions bash_aliases
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ alias sys='systemctl'
alias s='sudo'
alias p='python'
alias i='ipython'
alias fd=fdfind


#tmux
Expand All @@ -50,6 +49,14 @@ alias pacman='sudo pacman '
alias x='xclip'
alias w='mosh irc-bouncer -- tmux attach-session -t irc'

alias rg='rg --no-ignore'
alias rg='rg --no-ignore --hidden'
alias fd='fdfind -HIi'
alias vv='source venv/bin/activate'
alias watch='watch --color'
alias bd='base64 -d'

check_cert() {
echo "$1 is at $(dig +short $1)"
openssl s_client -connect $1:443 < /dev/null 2>/dev/null | openssl x509 -noout -dates -subject -issuer
}

55 changes: 41 additions & 14 deletions config
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ set $mod Mod4
# is used in the bar {} block below.
font pango:monospace 9

# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8

# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
Expand All @@ -30,8 +26,8 @@ font pango:monospace 9
floating_modifier $mod

# start a terminal with tmux
bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+Shift+Return exec TMUX=1 i3-sensible-terminal
bindsym $mod+Return exec RUN_TMUX=yes i3-sensible-terminal
bindsym $mod+Shift+Return exec RUN_TMUX=no i3-sensible-terminal

# kill focused window
bindsym $mod+Shift+q kill
Expand All @@ -56,17 +52,24 @@ bindsym $mod+Up focus up
bindsym $mod+Right focus right

# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+odiaeresis move right
#bindsym $mod+Shift+j move left
#bindsym $mod+Shift+k move down
#bindsym $mod+Shift+l move up
#bindsym $mod+Shift+odiaeresis move right

# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

# alternatively, you can use vim!!! shortcuts ...
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right


# split in horizontal orientation
#bindsym $mod+h split h
bindsym $mod+g split h
Expand Down Expand Up @@ -165,12 +168,12 @@ bar {
inactive_workspace #333333 #222222 #888888
urgent_workspace #2f343a #900000 #ffffff
}
status_command py3status -c ~/.i3status.conf
status_command py3status -c ~/.config/i3/i3status.conf
}

#set $Locker i3lock && sleep 1
set $Locker i3lock -c 000000 && sleep 2 && xset s activate
#set $Locker /usr/local/bin/lock && sleep 1
#set $Locker /usr/local/bin/lock && sleep 1
set $Locker /usr/local/bin/lock && sleep 1

bindsym $mod+Shift+u exec $Locker

Expand All @@ -191,6 +194,21 @@ mode "$mode_system" {

bindsym $mod+Pause mode "$mode_system"


set $mode_monitor System (1) intern, (2) extern, (3) both externals
mode "$mode_monitor" {
bindsym 1 exec --no-startup-id xrandr --output eDP1 --mode 1366x768 --output DP2-1 --off --output DP2-3 --off, mode "default"
bindsym 2 exec --no-startup-id xrandr --output DP2-1 --mode 1920x1080 --output eDP1 --off --output DP2-3 --off, mode "default"
bindsym 3 exec --no-startup-id xrandr --output DP2-3 --auto --output DP2-1 --mode 1920x1080 --right-of DP2-3 --output eDP1 --off, mode "default"

# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}

bindsym $mod+m mode "$mode_monitor"


#start chromium
bindsym $mod+i exec chromium
bindsym $mod+o exec firefox
Expand All @@ -213,6 +231,9 @@ bindsym $mod+t exec thunar
#bindsym XF86AudioLowerVolume exec pactl set-sink-volume 10 -5% && pactl set-sink-volume 12 -5%
#bindsym XF86AudioMute exec pactl set-sink-mute 10 'toggle' && pactl set-sink-mute 12 'toggle'

bindsym XF86MonBrightnessUp exec xbacklight -inc 10
bindsym XF86MonBrightnessDown exec xbacklight -dec 10

bindsym XF86AudioRaiseVolume exec bash ~/.local/increase_volume.sh
bindsym XF86AudioLowerVolume exec bash ~/.local/decrease_volume.sh
bindsym XF86AudioMute exec bash ~/.local/toggle_volume.sh
Expand All @@ -223,7 +244,13 @@ bindsym XF86AudioMicMute exec xdg-screensaver activate
#autostart owncloud and thunderbird
exec nextcloud
exec thunderbird
exec keepasxc

#move window to next output
bindsym $mod+n move container to output left
#bindsym $mod+n move container to output left

# screenshot
bindsym $mod+Shift+s exec "sleep 0.2; scrot -q 100 -s '%Y-%m-%d-%H%M%S_screenshot.png' -e 'mv $f ~/screenshots/'"

# turn off monitor
bindsym $mod+Shift+m exec "sleep 0.2; xdg-screensaver activate"
10 changes: 7 additions & 3 deletions gitconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[user]
name = kmille
email = christian.schneider@androidloves.me
name = kmille
email = github@androidloves.me
[alias]
s = status
l = log
c = commit -a -m
ls = log --stats
d = diff
ds = diff --stat
c = commit -a -m
ba = branch -a
[pull]
rebase = true
38 changes: 36 additions & 2 deletions i3status.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,30 @@ general {
colors = true
color_good = '#00FF00'
color_bad = '#FF0000'
interval = 5
interval = 5 # this does not work - seconds are updated every second
}

#order += "ipv6"
#order += "async_script blubb"
order += "vms"
order += "disk /"
#order += "run_watch DHCP"
#order += "run_watch VPN"
order += "wireless _first_"
#order = "wifi wifi0_py_new"
order += "ethernet _first_"
order += "battery 0"
order += "battery 1"
order += "load"
order += "volume master"
order += "tztime local"

async_script blubb {
format = "{output}"
script_path = "echo $(date)du bist toll!"
cache_timeout = 40
interval = 10 # this does not work - seconds are updated every second
}

volume master {
device = "default"
Expand All @@ -34,8 +43,22 @@ volume master {
format = "A %volume "
}

# das flappt wie sau
wifi wifi0_py_new {
#mac = shell(iwconfig wlp3s0 | grep 'Access Point' | awk '{ print tolower($NF\) }')
format = "\?if=ssid W: {bitrate} {bitrate_unit} {device} {freq_ghz} {freq_mhz} {ip} {signal_dbm} {signal_percent}% {ssid} {blocks} {mac}|W: :("

format = "\?if=ssid W: {signal_percent}% at {ssid} {ip} {freq_ghz}GHz {signal_dbm}dbBm|W: :("
cache_timeout = 10
#signal_degraded = 40
#signal_bad = 30
on_click 1 = "exec notify-send \"$(iwconfig wlp3s0)\""

}

wireless _first_ {
format_up = "W: (%quality at %essid) %ip"
#format_up = "W: (%quality at %essid) %ip"
format_up = "W: (%quality at %essid %frequency) %ip"
format_down = "W: down"
}

Expand All @@ -56,6 +79,17 @@ battery 0 {
#low_threshold = 45
}

battery 1 {
format = "%status %percentage %remaining"
format_down = "yolo"
last_full_capacity = true
integer_battery_capacity = false
threshold_type = "percentage"
low_threshold = 15
#threshold_type = "time"
#low_threshold = 45
}

run_watch DHCP {
pidfile = "/var/run/dhclient*.pid"
}
Expand Down
34 changes: 17 additions & 17 deletions tmux.conf
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
#set scroll history to 100,000 lines
set-option -g history-limit 1000000

#color
set -g default-terminal "screen-256color"
# active window has a different background color
set -g window-status-current-style bg=yellow

#delay to min time
set -sg escape-time 1

#vi movement
#vim navigation
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

setw -g monitor-activity on
set -g visual-activity on
# move window to the left/right with shift+l/h
bind-key H swap-window -t -1
bind-key L swap-window -t +1

# BEGIN copy paste
# 1) go in copy mode with ctrl+[
# 2) press v or shift+v to select text (ESC to abort without leaving copy mode)
bind-key -T copy-mode-vi v send-keys -X begin-selection
# 3) press y to yank
bind-key -T copy-mode-vi y send-keys -X copy-selection
# 4) press ctrl+p to paste in tmux
unbind P
bind P paste-buffer
# copy to clipboard
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -sel clip -i'
# END copy paste
# create new panes/windows in the same directory
bind '"' split-window -c "#{pane_current_path}"
bind '%' split-window -h -c "#{pane_current_path}"
bind c new-window -ac "#{pane_current_path}"

# use ctrl+[ => / to search (from top to down)
# use ctrl+[ => ? to search (bottom up)
# move pane to another window
bind-key J command-prompt -p "join pane from:" "join-pane -s '%%'"
bind-key S command-prompt -p "send pane to:" "join-pane -t '%%'"

# reload tmux
bind r source-file ~/.tmux.conf
49 changes: 21 additions & 28 deletions vimrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"set mouse=a
syntax on
set shiftwidth=4
set tabstop=4
Expand All @@ -16,35 +15,37 @@ set linebreak
map Q :qa<CR>
map q <Nop>
nnoremap <F1> <nop>
"noremap K <nop>
noremap K <nop>
"Ctl-J new line nach unten
"Ctl-J move line one line above
nnoremap <C-J> I<CR><Esc>
nnoremap <C-K> kdd
"tab switching

"" BEGIN TAB MAGIC
set tabpagemax=50
" color for the tab status line
hi TabLine ctermfg=LightYellow
hi TabLineSel ctermfg=LightGreen

"tab navigation
nnoremap H gT
nnoremap L gt
"backspace geht tab zur_ck
set softtabstop=4 expandtab
"tab reordering with ctrl+h/l
nnoremap <C-h> :execute 'silent! tabmove ' . (tabpagenr()-2)<CR>
nnoremap <C-l> :execute 'silent! tabmove ' . (tabpagenr()+1)<CR>
"" END TAB MAGIC

"set ttyfast
"set mouse=a
"set ttymouse=xterm2

colorscheme elflord
"set guifont=Monaco\ 12
"set guifont=Menlo-Regular\ 12
"backspace goes back a tab
set softtabstop=4 expandtab

colorscheme elflord

"open filename in new tab
nnoremap tt <c-w>gf


" go to next window with TAB
map <Tab> <C-W>w
nnoremap sp :set paste<CR>
nnoremap snp :set paste!<CR>
Expand All @@ -60,7 +61,6 @@ set timeoutlen=200
"clear;arrow up; enter; enter to clear vim :! message
nnoremap rr :w<CR> :! tmux send-keys -t bottom C-l C-p C-m<CR><CR>

"insert breakpoint() into next line
nnoremap bp obreakpoint()<Esc>
Expand All @@ -70,17 +70,10 @@ nnoremap pf oprint(f"")<Esc>hi
"insert print(f"{}") to next line
nnoremap pff oprint(f"{=}")<Esc>hhhi


" mm: make markdown (requires python-markdown)
nnoremap mm :w<CR> :! python -m markdown % -f %.html <CR><CR>
" mo: markdown open
nnoremap mo :! chromium %.html >/dev/null 2&1<CR><CR>
"############ END USING VIM AS IDE ############


" ## begin plugins
""" BEGIN plugins
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
" :PlugInstall
call plug#begin('~/.vim/plugged')
Expand All @@ -91,11 +84,11 @@ Plug 'airblade/vim-gitgutter'
call plug#end()

let g:ale_linters_explicit = 1
"let g:ale_linters = { 'yaml': ['yamllint']}
let g:ale_linters = { 'python': ['flake8']}
let g:ale_linters = { 'python': ['flake8'], 'puppet': ['puppetlint'], 'yaml': ['yamllint']}
let b:ale_fixers = {'python': ['autopep8']}
let g:ale_python_flake8_options='--ignore=E501,E265,E262,E731,E226,E261'
let g:ale_yaml_yamllint_options='-d "{extends: relaxed, rules: {line-length: disable}}"'
nnoremap fe :ALEFix<CR>
" settings for vim-gitgutter
set updatetime=5000
" ## end plugins
""" END plugins

0 comments on commit 95b0106

Please sign in to comment.