]> gitweb.ps.run Git - flake_thinkpad/blobdiff - home.nix
update home.nix
[flake_thinkpad] / home.nix
index 1124add00224939d0d6ac9b49de0e7269ec88c3c..877a6a98a1078b6d3935a6b1874f5895cadff808 100644 (file)
--- 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,25 @@ 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="Arbeitsfläche.*"] kill, floating enable, border none
 
       # class                 border  backgr. text    indicator child_border
       client.focused          #000000bf #000000bf #e6ebef #000000bf   #000000bf
@@ -277,9 +277,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 +356,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 <Down> gj
@@ -370,11 +383,87 @@ in
       inoremap <Down> <C-o>gj
       inoremap <Up> <C-o>gk
       tnoremap <Esc> <C-\><C-n>
+      map <Space> <Leader>
+      nnoremap <Esc> :noh<CR>
+      nnoremap gr :Telescope lsp_references<CR>
+      nnoremap gd :Telescope lsp_definitions<CR>
+      nnoremap <leader>u :UndotreeToggle<CR> :UndotreeFocus<CR>
+      nnoremap <leader>f :Telescope find_files<CR>
+      nnoremap <leader>b :Telescope buffers<CR>
+      nnoremap <leader>e :Telescope diagnostics<CR>
+      nnoremap <leader>g :Telescope live_grep<CR>
+      nnoremap <leader>s :Telescope lsp_document_symbols<CR>
+      nnoremap <leader>r :lua vim.lsp.buf.rename()<CR>
+      nnoremap <leader>n :bnext<CR>
+      nnoremap <leader>m :bprevious<CR>
+      noremap <leader>y "+y<CR>
+      noremap <leader>p "+p<CR>
+      noremap <leader><S-y> "+<S-y><CR>
+      noremap <leader><S-p> "+<S-p><CR>
+
+      " 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',
+          
+          ['<C-space>'] = { 'show', 'show_documentation', 'hide_documentation' },
+          ['<C-e>'] = { 'hide', 'fallback' },
+          ['<CR>'] = { 'accept', 'fallback' },
+
+          ['<Tab>'] = { 'select_next', 'fallback_to_mappings' },
+          ['<S-Tab>'] = { 'select_prev', 'fallback_to_mappings' },
+
+          ['<C-p>'] = { 'scroll_documentation_up', 'fallback' },
+          ['<C-n'] = { 'scroll_documentation_down', 'fallback' },
+
+          ['<C-k>'] = { 'show_signature', 'hide_signature', 'fallback' },
+        },
+        completion = {
+          list = { selection = { preselect = false, } },
+         documentation = {
+           auto_show = true,
+           -- treesitter_highlighting = false,
+         },
+        },
+        signature = { enabled = true },
       }
     '';
   };
@@ -419,7 +508,7 @@ in
   programs.emacs = {
     enable = true;
     extraConfig = ''
-      (menu-bar-mode 0)
+      (menu-bar-mode 1)
       (tool-bar-mode 0)
       (scroll-bar-mode 0)
       (global-display-line-numbers-mode)
@@ -669,17 +758,19 @@ in
     clang-tools bear
     linuxPackages_latest.perf
     texliveFull
+    asciidoctor-with-extensions
     emscripten
     caddy
     python3
     qogir-icon-theme
     volantes-cursors
     xorg.xkill
-    lf nnn
+    lf nnn yazi
     feh
     xarchiver
     tig lazygit gitui
     thunderbird
+    aerc
     libreoffice
     gimp
     guvcview
@@ -692,11 +783,12 @@ in
     wireshark
     nil
     bc
-    ffmpeg
+    ffmpeg-full
     sc-im visidata
     localsend
     vis
     wineWowPackages.unstableFull winetricks
+    signal-desktop
 
     # # It is sometimes useful to fine-tune packages, for example, by applying
     # # overrides. You can do that directly here, just don't forget the
@@ -739,9 +831,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'