From d1641e78b60aafbcd6233f2aa4cd50385a63ba92 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Sun, 5 May 2024 16:14:46 +0200 Subject: update --- .Xresources | 3 +- .config/i3status/config | 53 ++++++++++++++++++++++ .config/sway/config | 7 +-- .profile | 1 + .shrc | 2 + .vimrc | 115 ++++++++++++++++++++++++++++++++++++++++++++++++ .xinitrc | 1 + 7 files changed, 178 insertions(+), 4 deletions(-) create mode 100644 .config/i3status/config create mode 100644 .vimrc diff --git a/.Xresources b/.Xresources index 6cef873..5aa4167 100644 --- a/.Xresources +++ b/.Xresources @@ -20,7 +20,8 @@ xterm*termName: xterm-256color xterm*VT100.Translations: #override \ F11: fullscreen(toggle) \n\ Ctrl minus: smaller-vt-font() \n\ - Ctrl equal: larger-vt-font() \n + Ctrl equal: larger-vt-font() \n\ + Ctrl agrave: set-vt-font(d) \n xterm*cursorColor: red !xterm*visualBell: true !xterm*geometry: 100x32 diff --git a/.config/i3status/config b/.config/i3status/config new file mode 100644 index 0000000..2d5b443 --- /dev/null +++ b/.config/i3status/config @@ -0,0 +1,53 @@ +# i3status configuration file. +# see "man i3status" for documentation. + +# It is important that this file is edited as UTF-8. +# The following line should contain a sharp s: +# ß +# If the above line is not correctly displayed, fix your editor first! + +general { + colors = true + interval = 5 +} + +#order += "ipv6" +order += "wireless _first_" +#order += "ethernet _first_" +order += "battery all" +order += "disk /" +order += "load" +order += "memory" +order += "tztime local" + +wireless _first_ { + format_up = "W: (%quality at %essid) %ip" + format_down = "W: down" +} + +ethernet _first_ { + format_up = "E: %ip (%speed)" + format_down = "E: down" +} + +battery all { + format = "%status %percentage %remaining" +} + +disk "/" { + format = "%avail" +} + +load { + format = "%1min" +} + +memory { + format = "%used | %available" + threshold_degraded = "1G" + format_degraded = "MEMORY < %available" +} + +tztime local { + format = "%Y-%m-%d %H:%M:%S" +} diff --git a/.config/sway/config b/.config/sway/config index 93caf4d..6b67de0 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -63,7 +63,7 @@ input type:keyboard { xkb_layout "fr" } -input "1739:52544:SYNA7DAB:00_06CB:CD40_Touchpad" { +input type:touchpad { tap enabled natural_scroll enabled } @@ -216,11 +216,12 @@ bindsym $mod+r mode "resize" # # Read `man 5 sway-bar` for more information about this section. bar { - position top + position bottom # When the status_command prints a new line to stdout, swaybar updates. # The default just shows the current date and time. - status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done + # status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done + status_command i3status colors { statusline #ffffff diff --git a/.profile b/.profile index 1916dec..d97e6ee 100644 --- a/.profile +++ b/.profile @@ -1,3 +1,4 @@ export PATH=~/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:~/go/bin +export XDG_RUNTIME_DIR=/run/user/1000 [ "$SHELL" = /bin/ash ] && export ENV=~/.shrc diff --git a/.shrc b/.shrc index a29e6f7..5479ff9 100644 --- a/.shrc +++ b/.shrc @@ -7,5 +7,7 @@ alias sudo=doas alias sup='doas apk upgrade' alias apk='doas apk' alias dotfiles='git --git-dir=$HOME/dotfiles --work-tree=$HOME' +alias vi=vim +alias ww='vim ~/Wiki/home_page.md' mkcd() { mkdir -p "$1" && cd "$1"; } diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..cf4a9e4 --- /dev/null +++ b/.vimrc @@ -0,0 +1,115 @@ +" General vim defaults +" set background= +"set t_te= t_ti= +set ls=1 ruler +set ai ts=4 sw=4 noet +"set mouse=a +syntax off +filetype on +filetype plugin on +filetype plugin indent on +let mapleader = "," + +"set rtp+=/opt/homebrew/opt/fzf +let g:fzf_preview = 'cat {}' + +" vimki plugin +autocmd filetype vimki syntax on +autocmd filetype vimki set autowrite +" autocmd filetype vimki setlocal spell spelllang=fr +autocmd filetype vimki nmap z :FZF ~/Wiki + +" vim-go plugin +"let g:go_def_mode = "gopls" +"let g:go_info_mode = "gopls" +"let g:go_list_type = "quickfix" +"let g:go_fmt_command = "gopls" +"let g:go_gopls_gofumpt = 1 + +let g:go_gopls_enabled = 0 +let g:go_def_mode = "godef" +let g:go_fmt_command = "goimports" +let g:go_metalinter_command = "golangci-lint" +"autocmd FileType go syntax on +autocmd FileType go nmap b (go-build) +autocmd FileType go nmap i (go-info) +autocmd FileType go nmap r (go-run) +autocmd FileType go nmap t (go-test) +autocmd FileType go nmap f (go-test-func) +autocmd FileType go nmap v (go-referrers) +autocmd FileType go nmap n :cnext +autocmd FileType go nmap p :cprevious +autocmd FileType go nmap a :cclose +" autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4 + +let g:netrw_browsex_viewer = "xdg-open" +let g:netrw_gx = "" +let g:netrw_banner = 0 + +" python and yaml formatting: +autocmd filetype python,yaml set ts=2 sts=2 sw=2 et + +:set wrap +:set linebreak +:set nolist +:set formatoptions-=t +" noremap :!cscope -1 +" noremap :!cscope -0 +" noremap :!cscope -7 + +" Paragraph format / unformat +noremap f !}fmt +noremap F !}fmt -c -w 2048 + +" noremap K :s,^,//, +" noremap :s,^//,, +noremap # :s,^,#, +noremap @ :s,^#,, +"hi MatchParen term=reverse ctermbg=magenta ctermfg=none +" hi MatchParen cterm=reverse term=reverse ctermfg=white +" + +" Fix spell highlighting +hi clear SpellBad +hi SpellBad cterm=underline +hi SpellBad gui=undercurl + +noremap n :bn +noremap :bd +noremap o :!xdg-open & +noremap :tag +noremap :Files + +""""""""""""" My cscope/vim key mappings + " + " The following maps all invoke one of the following cscope search types: + " + " 's' symbol: find all references to the token under cursor + " 'g' global: find global definition(s) of the token under cursor + " 'c' calls: find all calls to the function name under cursor + " 't' text: find all instances of the text under cursor + " 'e' egrep: egrep search for the word under cursor + " 'f' file: open the filename under cursor + " 'i' includes: find files that include the filename under cursor + " 'd' called: find functions that function under cursor calls + +if has("cscope") + set csto=0 + set cst + set nocsverb + if filereadable("cscope.out") + cs add cscope.out + elseif $CSCOPE_DB + cs add $CSCOPE_DB + endif + set csverb +endif + +nmap cs :cs find s =expand("") +nmap cg :cs find g =expand("") +nmap cc :cs find c =expand("") +nmap ct :cs find t =expand("") +nmap ce :cs find e =expand("") +nmap ci :cs find i =expand("") +nmap cf :cs find f =expand("") +nmap cd :cs find d =expand("") diff --git a/.xinitrc b/.xinitrc index f4c1ed9..999cd20 100644 --- a/.xinitrc +++ b/.xinitrc @@ -1,4 +1,5 @@ #!/bin/sh +xhost + local: xrdb .Xresources xsetroot -solid rgb:1/3/4 exec i3 -- cgit v1.2.3