X-Git-Url: https://gitweb.ps.run/flake_thinkpad/blobdiff_plain/f89fd0467e70e17b3bf2d18049b786e5a56325d0..ac72bd3ed5bd39a5c77b43469a5274dad9a7ef95:/home.nix diff --git a/home.nix b/home.nix index 7a69d16..3f34dd3 100644 --- a/home.nix +++ b/home.nix @@ -73,7 +73,6 @@ in enable = true; mapExpression = { Caps_Lock = "Escape"; - Super_L = "Alt_L|F1"; }; }; @@ -108,9 +107,7 @@ in bars = []; modifier = "Mod4"; terminal = "${pkgs.kitty}/bin/kitty"; - gaps = { - inner = 5; - }; + gaps = { inner = 0; outer = 0; }; keybindings = let mod = config.xsession.windowManager.i3.config.modifier; @@ -208,7 +205,7 @@ in in lib.mkOptionDefault { # "${mod}+d" = "exec --no-startup-id krunner"; - "${mod}+Shift+p" = "exec --no-startup-id set-wallpaper"; + # "${mod}+Shift+p" = "exec --no-startup-id set-wallpaper"; "${mod}+Shift+Return" = "exec --no-startup-id ${pkgs.kitty}/bin/kitty -d $(${pkgs.xcwd}/bin/xcwd)"; "${mod}+BackSpace" = "kill"; "${mod}+Prior" = "workspace prev_on_output"; @@ -220,22 +217,26 @@ in "${mod}+Ctrl+Left" = "move workspace to output left"; "${mod}+Ctrl+Right" = "move workspace to output right"; "${mod}+y" = "exec --no-startup-id mirror-phone"; - "${mod}+n" = "exec ${pkgs.kitty}/bin/kitty ${pkgs.helix}/bin/hx -w ~/sync/txt ~/sync/txt"; + "${mod}+n" = "exec ${pkgs.kitty}/bin/kitty -d ~/sync/txt $EDITOR ."; "${mod}+m" = "exec --no-startup-id i3-msg $(${i3-max})"; + "${mod}+b" = "split toggle; layout tabbed"; "${mod}+Shift+m" = "exec --no-startup-id i3-msg $(${i3-move-max})"; + "${mod}+Shift+p" = "exec --no-startup-id ${pkgs.autorandr}/bin/autorandr --match-edid -c -f"; }; }; extraConfig = '' + # exec ${pkgs.xfce.xfce4-panel}/bin/xfce4-panel for_window [window_role="pop-up"] floating enable for_window [window_role="task_dialog"] floating enable # for_window [workspace="0"] floating enable for_window [class="kitty-popup"] floating enable for_window [class="Xfce4-appfinder"] floating enable - for_window [class=".blueman-manager-wrapped"] floating enable for_window [class="yakuake"] floating enable for_window [class="systemsettings"] floating enable for_window [title="win7"] floating enable; border none + for_window [title="Desktop — Plasma"] kill, floating enable, border none + for_window [title="Arbeitsfläche — Plasma"] kill, floating enable, border none # class border backgr. text indicator child_border client.focused #000000bf #000000bf #e6ebef #000000bf #000000bf @@ -277,9 +278,11 @@ in snrs = "sudo nixos-rebuild switch --flake /etc/nixos#default"; snrt = "sudo nixos-rebuild test --flake /etc/nixos#default"; snrb = "sudo nixos-rebuild boot --flake /etc/nixos#default"; - senc = "sudo ${pkgs.helix}/bin/hx /etc/nixos/configuration.nix"; - senh = "sudo ${pkgs.helix}/bin/hx /etc/nixos/home.nix"; + senc = "sudo $EDITOR /etc/nixos/configuration.nix"; + senh = "sudo $EDITOR /etc/nixos/home.nix"; + senf = "sudo $EDITOR /etc/nixos/flake.nix"; flakerun = "nix run --override-input nixpkgs nixpkgs"; + n = "nvim"; }; }; @@ -354,13 +357,24 @@ in goyo-vim vim-visual-multi nvim-lspconfig + blink-cmp + telescope-nvim + undotree + which-key-nvim + guess-indent-nvim ]; extraConfig = '' set number set relativenumber set tabstop=4 set shiftwidth=4 + set expandtab set foldmethod=marker + set autoindent + set smartindent + filetype plugin indent on + set signcolumn=yes + colorscheme habamax nnoremap gj @@ -370,11 +384,87 @@ in inoremap gj inoremap gk tnoremap + map + nnoremap :noh + nnoremap gr :Telescope lsp_references + nnoremap gd :Telescope lsp_definitions + nnoremap u :UndotreeToggle :UndotreeFocus + nnoremap f :Telescope find_files + nnoremap b :Telescope buffers + nnoremap e :Telescope diagnostics + nnoremap g :Telescope live_grep + nnoremap s :Telescope lsp_document_symbols + nnoremap r :lua vim.lsp.buf.rename() + nnoremap n :bnext + nnoremap m :bprevious + noremap y "+y + noremap p "+p + noremap "+ + noremap "+ + + " Format on save + " augroup FormatAutogroup + " autocmd! + " autocmd BufWritePost * FormatWrite + " augroup END + + " enter insert mode when opening terminal + autocmd TermOpen * startinsert + + " + autocmd BufReadPost * + \ if line("'\"") > 1 && line("'\"") <= line("$") && &ft !~# 'commit' + \ | exe "normal! g`\"" + \ | endif + + " Use persistent history. + if !isdirectory("/tmp/.vim-undo-dir") + call mkdir("/tmp/.vim-undo-dir", "", 0700) + endif + set undodir=/tmp/.vim-undo-dir + set undofile ''; extraLuaConfig = '' - require('lspconfig').zls.setup{} + vim.lsp.enable('zls') + vim.lsp.enable('clangd') + vim.lsp.config('zuban', {}) + vim.lsp.enable('zuban') + require('guess-indent').setup {} + local util = require('formatter.util') + local telescope = require('telescope') require('formatter').setup { - + logging = true, + log_level = vim.log.levels.WARN, + filetype = { + c = { require("formatter.filetypes.c").clangformat }, + cpp = { require("formatter.filetypes.cpp").clangformat }, + zig = { require("formatter.filetypes.zig").zigfmt }, + } + } + require('blink.cmp').setup { + keymap = { + preset = 'none', + + [''] = { 'show', 'show_documentation', 'hide_documentation' }, + [''] = { 'hide', 'fallback' }, + [''] = { 'accept', 'fallback' }, + + [''] = { 'select_next', 'fallback_to_mappings' }, + [''] = { 'select_prev', 'fallback_to_mappings' }, + + [''] = { 'scroll_documentation_up', 'fallback' }, + [''] = { 'show_signature', 'hide_signature', 'fallback' }, + }, + completion = { + list = { selection = { preselect = false, } }, + documentation = { + auto_show = true, + -- treesitter_highlighting = false, + }, + }, + signature = { enabled = true }, } ''; }; @@ -669,6 +759,7 @@ in clang-tools bear linuxPackages_latest.perf texliveFull + asciidoctor-with-extensions emscripten caddy python3 @@ -680,6 +771,7 @@ in xarchiver tig lazygit gitui thunderbird + aerc libreoffice gimp guvcview @@ -692,7 +784,7 @@ in wireshark nil bc - ffmpeg + ffmpeg-full sc-im visidata localsend vis @@ -740,9 +832,8 @@ in (pkgs.writeShellScriptBin "fzfdir" '' find "$1" -name "$2" | ${pkgs.fzf}/bin/fzf --layout=reverse '') - (pkgs.writeShellScriptBin "md-app" '' - #popup bash -c 'file=$(fzfdir "md" "*.md") && run md $file' - firefox -p appmode --new-window localhost:8123/home/ps/sync/txt/hsrm + (pkgs.writeShellScriptBin "file-app" '' + app localhost:8123 '') (pkgs.writeShellScriptBin "run-popup" '' popup bash -c 'file=$(compgen -c | grep -v fzf | sort -u | fzf --layout=reverse --print-query | tail -n 1) && run $file'