diff options
-rw-r--r-- | Common/i3/config/i3/config | 8 | ||||
-rwxr-xr-x | Common/nvim/lua/helper_functions.lua | 20 | ||||
-rwxr-xr-x | Common/nvim/lua/plugins.lua | 9 | ||||
-rwxr-xr-x | bin/kblayout.sh | 6 |
4 files changed, 42 insertions, 1 deletions
diff --git a/Common/i3/config/i3/config b/Common/i3/config/i3/config index 552c5dc..1b04fc2 100644 --- a/Common/i3/config/i3/config +++ b/Common/i3/config/i3/config @@ -115,7 +115,7 @@ bindsym $super+Shift+r restart #bindsym $super+l exec i3lock -f -c 63bfb6 #-i /home/jakob/.lockscreen.png bindsym $super+l exec dbus-send --type=method_call --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock bindsym $super+Shift+e exec "i3-nagbar -t warning -m 'Really, exit?' -b 'Yes' 'i3-msg exit'" -bindsym $super+p exec --no-startup-id ~/.config/rofi/bin/applet_powermenu +bindsym $super+p exec --no-startup-id /home/jakob/.config/rofi/bin/applet_powermenu # resize window (you can also use the mouse for that) mode "resize" { @@ -188,3 +188,9 @@ bindsym XF86MonBrightnessDown exec --no-startup-id "/home/jakob/bin/brightness-p bindsym XF86Display exec --no-startup-id "arandr" bindsym Print exec --no-startup-id "gnome-screenshot --interactive" bindsym XF86Favorites exec --no-startup-id "kill -s USR1 $(pidof deadd-notification-center)" + +# Keybinds for switching keyboard layout +#bindsym $super+Shift+F1 exec setxkbmap -layout no; notify-send.py "Keyboard layout NO" +#bindsym $super+Shift+F2 exec setxkbmap -layout gb; notify-send.py "Keyboard layout EN" +bindsym $super+Shift+F1 exec "/home/jakob/bin/kblayout.sh no" +bindsym $super+Shift+F2 exec "/home/jakob/bin/kblayout.sh us" diff --git a/Common/nvim/lua/helper_functions.lua b/Common/nvim/lua/helper_functions.lua index cac6c00..715c2a7 100755 --- a/Common/nvim/lua/helper_functions.lua +++ b/Common/nvim/lua/helper_functions.lua @@ -21,6 +21,26 @@ function ToggleListChars() vim.opt.listchars = list_chars_enabled and list_chars_when_enabled or 'eol:$' end +-- Command to join lines in buffer as list +function JoinLines(args, quotes) + r = args.args + o = "" + for k, v in pairs(vim.fn.getreg(r, 1, 1)) do + if k > 1 then o = o .. ", " end + if quotes ~= nil then o = o .. quotes end + o = o .. v:match( "^%s*(.-)%s*$" ) -- Strip leading and trailing + if quotes ~= nil then o = o .. quotes end + end + vim.fn.setreg(r, o) +end +function JoinLinesSQ(args) JoinLines(args, "'") end +function JoinLinesDQ(args) JoinLines(args, '"') end +function JoinLinesBT(args) JoinLines(args, "`") end +vim.api.nvim_create_user_command('JoinLines', JoinLines, {bang=false, desc='Joins all lines in a register', nargs='?'}) +vim.api.nvim_create_user_command('JoinLinesSQ', JoinLinesSQ, {bang=false, desc='Joins all lines in a register', nargs='?'}) +vim.api.nvim_create_user_command('JoinLinesDQ', JoinLinesDQ, {bang=false, desc='Joins all lines in a register', nargs='?'}) +vim.api.nvim_create_user_command('JoinLinesBT', JoinLinesBT, {bang=false, desc='Joins all lines in a register', nargs='?'}) + -- Close buffer without closing window --[[ vim.cmd [[ diff --git a/Common/nvim/lua/plugins.lua b/Common/nvim/lua/plugins.lua index 555dad3..3077560 100755 --- a/Common/nvim/lua/plugins.lua +++ b/Common/nvim/lua/plugins.lua @@ -16,6 +16,8 @@ vim.cmd([[ return require('packer').startup(function(use) -- Packer itself :) use 'wbthomason/packer.nvim' + -- targets (extends vim's targets, allowing things like multiline select inside backticks) + use 'wellle/targets.vim'; -- GitSigns use { @@ -160,6 +162,13 @@ return require('packer').startup(function(use) use 'mfussenegger/nvim-jdtls' + -- Goyo :) + use { + 'junegunn/goyo.vim' + } + use { 'smithbm2316/centerpad.nvim' } + + -- packer.nvim -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins if packer_bootstrap then diff --git a/bin/kblayout.sh b/bin/kblayout.sh new file mode 100755 index 0000000..600fb95 --- /dev/null +++ b/bin/kblayout.sh @@ -0,0 +1,6 @@ +!#/bin/bash + +#LAYOUT=$(setxkbmap -query) + +setxkbmap -layout "$1" +notify-send.py "Keyboard layout: $1" |