From 2cfb13ad4004c32aebb010aaaa05c2454f72e203 Mon Sep 17 00:00:00 2001 From: FredzyW Date: Mon, 27 May 2024 17:25:52 +0200 Subject: [PATCH] =?UTF-8?q?=C3=84ndringar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .flake.nix.swp | Bin 0 -> 12288 bytes config/home.nix | 2 + flake.lock | 100 +++++++-------------------------------- flake.nix | 22 --------- moduler/common/kitty.nix | 2 +- moduler/common/tmux.nix | 4 +- moduler/common/vim.nix | 99 ++++++++++++++++++++++++++------------ 7 files changed, 91 insertions(+), 138 deletions(-) create mode 100644 .flake.nix.swp diff --git a/.flake.nix.swp b/.flake.nix.swp new file mode 100644 index 0000000000000000000000000000000000000000..27ea9d8c763997207f1352deed4c8696eeab5b49 GIT binary patch literal 12288 zcmYc?2=nw+u+%ePU|?VnU|?8L7Lq0^bB-a>n3o}~93)5>=Oh-C|=lJQo9lI~N0k4i^K1AQuAz4;KT&4^9S#t(*)Dy_^gT9h?jd^_&b05u6MR z4x9`Os+VJ$lY z!vuB)hEjG0hG=#MhA?&p1}Am~23>XrhF5G13@g|e7#6cJFwA0OV2EU6U{GaaVBlb5 zV0g>Qz;KC`f#EDG1H&{{28MiA28J|N1_ljQ28J&z3=G#<7#Q}jFfc4(VPKfg!oZNh z!oc9j!oXm`!oXn2!oZ-z0*%8VmA_a(^(xSwY%=|osw9K4T1seuV&RS~*PEO9;%8dNtlDx#+ zR0UfFrL6pK zI7C2BF31K850je0g1`kiRr1udKDIC@n$BvIhlE-6)*#p(#jpcmMhqz zI9@L&Gf5BR8()ZLoWcHw`2}VpG%`R|(=)VEQj4=o@(Ttmz+m>18)lrGvEaDYsD{Rr zj)I<^o2p>sfc6~O7n_K5|eUL z5k_F7ZFp)zic%cO7P3xmz~TXFJsHseO4%q$8WhfuRIRMwSeBTX0}iB;jH3L~^b7@c zka~E&*3|{C_fybQuFNkj(k(4cEdu3Z2QUwotJT55sH_lNl9-p0n3JEEiju$33WwCZ zlA_9j{LH)(2CzPO#)2~x6p*4rPd_)YI6E^hwMZY7d7-5fG_w&MFEDnR&=b4iq*ZjFf2ODR1)JqAut`URzG9R^Nlpy@DhqPtB8tRA@(g@{1aK{y~gK`dySN5NL1 z8dMrWV^dinBe5u@Jh3QMue2x!!<9mv05yRKji?Uy zgEToAKv@#hU Our main home-manager configuration file < modules = [./config/home.nix]; }; - "fw@server" = home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages.x86_64-linux; - extraSpecialArgs = { - inherit inputs outputs; - myhostname = "server"; - }; - # > Our main home-manager configuration file < - modules = [./config/server.nix]; - }; }; }; } diff --git a/moduler/common/kitty.nix b/moduler/common/kitty.nix index 835a040..3c15abe 100644 --- a/moduler/common/kitty.nix +++ b/moduler/common/kitty.nix @@ -4,7 +4,7 @@ enable = true; font = if myhostname == "laptop" then { name = "FiraCode Nerd Font"; - size = 24; + size = 20; } else { name = "FiraCode Nerd Font"; size = 18; diff --git a/moduler/common/tmux.nix b/moduler/common/tmux.nix index 7b1dc24..6f50a5e 100644 --- a/moduler/common/tmux.nix +++ b/moduler/common/tmux.nix @@ -12,8 +12,8 @@ extraConfig = '' set -g @dracula-show-powerline true # available plugins: battery, cpu-usage, git, gpu-usage, ram-usage, tmux-ram-usage, network, network-bandwidth, network-ping, ssh-session, attached-clients, network-vpn, weather, time, mpc, spotify-tui, playerctl, kubernetes-context, synchronize-panes - # set -g @dracula-plugins 'spotify-tui battery time' - set -g @dracula-plugins 'battery time' + set -g @dracula-plugins 'spotify-tui battery time' + # set -g @dracula-plugins 'battery time' set -g @dracula-refresh-rate 10 set -g @dracula-show-timezone false set -g @dracula-military-time true diff --git a/moduler/common/vim.nix b/moduler/common/vim.nix index a03c739..bd1aaa3 100644 --- a/moduler/common/vim.nix +++ b/moduler/common/vim.nix @@ -1,41 +1,82 @@ { pkgs, lib, ... }: { - environment.variables = { EDITOR = "vim"; }; - - environment.systemPackages = with pkgs; [ - ((vim_configurable.override { }).customize{ - name = "vim"; - # Install plugins for example for syntax highlighting of nix files - vimrcConfig.packages.myplugins = with pkgs.vimPlugins; { - start = [ + programs.vim = { + enable = true; + plugins = with pkgs.vimPlugins; [ + ale vim-nix vim-lastplace - vim-dracula + dracula-vim vim-sensible vim-commentary vim-fugitive fzf-vim YouCompleteMe + asyncomplete-vim + asyncomplete-lsp-vim + ultisnips + vim-snippets + vim-lsp + vim-lsp-snippets + vim-lsp-ultisnips + vim-lsp-settings + asyncomplete-lsp-vim ]; - opt = []; - }; - vimrcConfig.customRC = '' - nnoremap e :Files - nnoremap w :w - nnoremap q :q - nnoremap :bnext - nnoremap :bprev - inoremap pumvisible() ? "\" : "\" - inoremap pumvisible() ? "\" : "\" - inoremap pumvisible() ? asyncomplete#close_popup() : "\" + settings = { ignorecase = true; }; + extraConfig = '' + nnoremap f :Files + nnoremap w :w + nnoremap q :q + nnoremap :bnext + nnoremap :bprev + inoremap pumvisible() ? "\" : "\" + inoremap pumvisible() ? "\" : "\" + inoremap pumvisible() ? asyncomplete#close_popup() : "\" - set cmdheight=1 - set relativenumber - set wrap - set shiftwidth=4 - set tabstop=4 - set termguicolors - ''; - } - )]; + set cmdheight=1 + set relativenumber + set wrap + set shiftwidth=4 + set tabstop=4 + set termguicolors + colorscheme dracula + + function! s:on_lsp_buffer_enabled() abort + setlocal omnifunc=lsp#complete + setlocal signcolumn=yes + if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif + nmap gd (lsp-definition) + nmap gs (lsp-document-symbol-search) + nmap gS (lsp-workspace-symbol-search) + nmap gr (lsp-references) + nmap gi (lsp-implementation) + nmap gt (lsp-type-definition) + nmap rn (lsp-rename) + nmap [g (lsp-previous-diagnostic) + nmap ]g (lsp-next-diagnostic) + nmap K (lsp-hover) + nnoremap lsp#scroll(+4) + nnoremap lsp#scroll(-4) + + let g:lsp_format_sync_timeout = 1000 + autocmd! BufWritePre *.rs,*.go call execute('LspDocumentFormatSync') + + " refer to doc to add more commands + endfunction + + augroup lsp_install + au! + " call s:on_lsp_buffer_enabled only for languages that has the server registered. + autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled() + augroup END + if executable('nil') + autocmd User lsp_setup call lsp#register_server({ + \ 'name': 'nil', + \ 'cmd': {server_info->['nil']}, + \ 'whitelist': ['nix'], + \ }) + endif + + ''; + }; }