]> gitweb.ps.run Git - flake_thinkpad/blobdiff - home.nix
update config
[flake_thinkpad] / home.nix
index 14dd4c3375d20c089928d70e6f7c7d87cf7de6b7..fcf744d0fcbee41d5bbaa258f5db356b94bb56cf 100644 (file)
--- a/home.nix
+++ b/home.nix
@@ -73,7 +73,6 @@ in
     enable = true;
     mapExpression = {
       Caps_Lock = "Escape";
     enable = true;
     mapExpression = {
       Caps_Lock = "Escape";
-      Super_L = "Alt_L|F1";
     };
   };
 
     };
   };
 
@@ -208,7 +207,7 @@ in
         in lib.mkOptionDefault
           {
             # "${mod}+d" = "exec --no-startup-id krunner";
         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";
             "${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,12 +219,14 @@ 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}+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}+Shift+m" = "exec --no-startup-id i3-msg $(${i3-move-max})";
             "${mod}+m" = "exec --no-startup-id i3-msg $(${i3-max})";
             "${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 = ''
           };
     };
     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 [window_role="pop-up"] floating enable
       for_window [window_role="task_dialog"] floating enable
       # for_window [workspace="0"] floating enable
@@ -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";
       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";
       flakerun = "nix run --override-input nixpkgs nixpkgs";
+      n = "nvim";
     };
   };
 
     };
   };
 
@@ -356,14 +359,22 @@ in
       nvim-lspconfig
       blink-cmp
       telescope-nvim
       nvim-lspconfig
       blink-cmp
       telescope-nvim
-      trouble-nvim
+      undotree
+      which-key-nvim
+      guess-indent-nvim
     ];
     extraConfig = ''
       set number
       set relativenumber
       set tabstop=4
       set shiftwidth=4
     ];
     extraConfig = ''
       set number
       set relativenumber
       set tabstop=4
       set shiftwidth=4
+      set expandtab
       set foldmethod=marker
       set foldmethod=marker
+      set autoindent
+      set smartindent
+      filetype plugin indent on
+      set signcolumn=yes
+
       colorscheme habamax
 
       nnoremap <Down> gj
       colorscheme habamax
 
       nnoremap <Down> gj
@@ -373,11 +384,62 @@ in
       inoremap <Down> <C-o>gj
       inoremap <Up> <C-o>gk
       tnoremap <Esc> <C-\><C-n>
       inoremap <Down> <C-o>gj
       inoremap <Up> <C-o>gk
       tnoremap <Esc> <C-\><C-n>
+      map <Space> <Leader>
+      nnoremap <Esc> :noh<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 :Telescope lsp_references<CR>
+      nnoremap <leader><S-r> :Telescope lsp_references<CR><C-q>
+      nnoremap <leader>d :Telescope lsp_definitions<CR>
+      noremap <leader>y "+y"<CR>
+      noremap <leader>p "+p"<CR>
+
+      " augroup FormatAutogroup
+      "   autocmd!
+      "   autocmd BufWritePost * FormatWrite
+      " augroup END
+
+      autocmd BufReadPost *
+      \ if line("'\"") > 1 && line("'\"") <= line("$") && &ft !~# 'commit'
+      \ |   exe "normal! g`\""
+      \ | endif
     '';
     extraLuaConfig = ''
       require('lspconfig').zls.setup{}
     '';
     extraLuaConfig = ''
       require('lspconfig').zls.setup{}
+      require('lspconfig').clangd.setup{}
+      local util = require('formatter.util')
       require('formatter').setup {
       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, } },
+        },
       }
     '';
   };
       }
     '';
   };
@@ -683,6 +745,7 @@ in
     xarchiver
     tig lazygit gitui
     thunderbird
     xarchiver
     tig lazygit gitui
     thunderbird
+    aerc
     libreoffice
     gimp
     guvcview
     libreoffice
     gimp
     guvcview