From 9413ddffe0ab9ab0700f9a2f5fd78fe559003256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Tue, 2 Apr 2019 23:24:31 +0200 Subject: [PATCH] add passmenu, vim shortcuts --- configs/editors.nix | 21 +-------- configs/packages.nix | 41 ++++++++++++++--- dot/i3.nix | 103 ++++++++++++++++++++++--------------------- dot/vimrc | 22 +++++++-- main.nix | 4 ++ theme.nix | 4 +- 6 files changed, 113 insertions(+), 82 deletions(-) diff --git a/configs/editors.nix b/configs/editors.nix index b35974e..379e835 100644 --- a/configs/editors.nix +++ b/configs/editors.nix @@ -42,7 +42,6 @@ in { ]; opt = [ csv - deoplete-jedi deoplete-rust dhall-vim elm-vim @@ -53,15 +52,7 @@ in { vim-javascript vim-nix vimtex - (pkgs.vimUtils.buildVimPluginFrom2Nix { - name = "vim-ledger"; - src = pkgs.fetchFromGitHub { - owner = "ledger"; - repo = "vim-ledger"; - rev = "6eb3bb21aa979cc295d0480b2179938c12b33d0d"; - sha256 = "0rbwyaanvl2bqk8xm4kq8fkv8y92lpf9xx5n8gw54iij7xxhnj01"; - }; - }) + vim-ledger (pkgs.vimUtils.buildVimPluginFrom2Nix { name = "vim-fsharp"; src = pkgs.fetchFromGitHub { @@ -80,16 +71,6 @@ in { sha256 = "0vl4267hh8g1vkvc3awlqyypgz4m1r43d47sldl80yamiafiviaj"; }; }) - (pkgs.vimUtils.buildVimPluginFrom2Nix { - name = "ghcid"; - src = "${(pkgs.fetchFromGitHub { - owner = "ndmitchell"; - repo = "ghcid"; - rev = "5288801e7f046c42972527cd94171ce893ba91cf"; - sha256 = "0dgxsl1dci6w3x662c7z1zw8yvfnch4ymhsvx29n7jkgqmcy1lki"; - }).out}/plugins/nvim"; - }) - ]; }; }; diff --git a/configs/packages.nix b/configs/packages.nix index 46e8f61..db87222 100644 --- a/configs/packages.nix +++ b/configs/packages.nix @@ -9,7 +9,31 @@ let url = "https://cgit.krebsco.de/stockholm/plain/krebs/5pkgs/simple/dic/default.nix?id=8371e21c10bdb5d5353cc581efba7e09e4ce7a91"; sha256 = "1vd8mg1ac7wzrcs5bl20srkxcs65zr7rd7y3wxzrxspij5wrb23i"; }; + yt-next-pkg = pkgs.fetchurl { + url = http://cgit.lassul.us/stockholm/plain/lass/5pkgs/yt-next/default.nix; + sha256 = "0j9r9xy34sl9ci5lz38060b3nakf0vd7gw46pykdiriwz6znbxn3"; + }; + urlencode-pkg = pkgs.fetchurl { + url = http://cgit.lassul.us/stockholm/plain/krebs/5pkgs/simple/urlencode/default.nix; + sha256 = "0cxf0fcaq02krkn33qipv878drqnjr035a564m66wp9x8n2zjgim"; + }; + acronym-pkg = pkgs.fetchurl { + url = http://cgit.lassul.us/stockholm/plain/lass/5pkgs/acronym/default.nix; + sha256 = "1rpr1rniz74vmkl4r3hgrg8q7ncxrvbf7zp0lq9b7lva85i12zx9"; + }; + urban-pkg = pkgs.fetchurl { + url = http://cgit.lassul.us/stockholm/plain/lass/5pkgs/urban/default.nix; + sha256 = "128v0znnapcqbyvc0nf112ddfyipr8sc1z4kcnggnbjf99i763ji"; + }; + mpv-poll-pkg = pkgs.fetchurl { + url = http://cgit.lassul.us/stockholm/plain/lass/5pkgs/mpv-poll/default.nix; + sha256 = "0ccmm7spxll98j8gy58fc3p8331arznshsj5wn4kkcypcs16n6ci"; + }; dic = pkgs.callPackage dic-pkg {}; + yt-next = pkgs.callPackage yt-next-pkg {}; + acronym = pkgs.callPackage acronym-pkg {}; + urban = pkgs.callPackage urban-pkg {}; + mpv-poll = pkgs.callPackage mpv-poll-pkg {}; haskells = import ../dot/haskells.nix; unstable = import {}; executables = pkgs.haskell.lib.justStaticExecutables; @@ -143,7 +167,7 @@ in with pkgs; (executables haskellPackages.cabal-install) (executables haskellPackages.ghcid) (executables haskellPackages.hakyll) - (executables haskellPackages.brittany) + (haskellPackages.brittany) (executables haskellPackages.hfmt) (executables haskellPackages.hasktags) # (executables haskellPackages.hindent) @@ -157,15 +181,16 @@ in with pkgs; mypy nix-prefetch-git nodejs - nodePackages.eslint nodePackages.csslint nodePackages.prettier + nodePackages.jsonlint ocaml python3 python3Packages.black - # python3Packages.yapf + python3Packages.python-language-server + python3Packages.pyls-mypy python3Packages.flake8 - python3Packages.jedi + # python3Packages.jedi ruby rubocop rustup @@ -202,13 +227,17 @@ in with pkgs; memo par fzf - pass + (pass.withExtensions (ext: [ext.pass-otp])) qrencode sncli - dic tmuxp unstable.hledger wordnet xsv + dic + yt-next + mpv-poll + acronym + urban ] ++ (if config.networking.hostName == "homeros" then [ unstable.zeroad ] else []); } diff --git a/dot/i3.nix b/dot/i3.nix index 8f7c2d1..bbadc96 100644 --- a/dot/i3.nix +++ b/dot/i3.nix @@ -54,20 +54,20 @@ rec { childBorder = colorScheme.green.light; }; }; - bars = [{ - workspaceButtons = false; - fonts = [ "${terminalFont.name} ${toString terminalFont.size}" ]; - mode = "hide"; - colors = { - background = colorScheme.background; - separator = colorScheme.background; - statusline = colorScheme.foreground; - bindingMode = { - background = colorScheme.red.light; - border = colorScheme.background; - text = colorScheme.foreground; + bars = [{ + workspaceButtons = false; + fonts = [ "${terminalFont.name} ${toString terminalFont.size}" ]; + mode = "hide"; + colors = { + background = colorScheme.background; + separator = colorScheme.background; + statusline = colorScheme.foreground; + bindingMode = { + background = colorScheme.red.light; + border = colorScheme.background; + text = colorScheme.foreground; + }; }; - }; # position = "top"; statusCommand = let @@ -136,41 +136,42 @@ rec { in '' ${pkgs.i3status}/bin/i3status -c ${i3status-config} ''; - }]; - keybindings = { - "${modifier}+Down" = "focus down"; - "${modifier}+Left" = "focus left"; - "${modifier}+Return" = "exec ${config.defaultApplications.terminal}"; - "${modifier}+Right" = "focus right"; - "${modifier}+Shift+Down" = "move down"; - "${modifier}+Shift+Left" = "move left"; - "${modifier}+Shift+Right" = "move right"; - "${modifier}+Shift+Up" = "move up"; - "${modifier}+Shift+c" = "reload"; - "${modifier}+Shift+n" = "move window to workspace next"; - "${modifier}+Shift+b" = "move window to workspace prev"; - "${modifier}+Shift+q" = "kill"; - "${modifier}+Shift+r" = "restart"; - "${modifier}+Shift+w" = "exec ${pkgs.xautolock}/bin/xautolock -locknow"; - "${modifier}+Shift+x" = "exec --no-startup-id ${move-to-new-workspace}"; - "${modifier}+Shift+z" = "floating toggle"; - "${modifier}+Up" = "focus up"; - "${modifier}+a" = "exec ${pkgs.rofi}/bin/rofi -display-window — -show window"; - "${modifier}+d" = "exec ${pkgs.rofi}/bin/rofi -display-run — -show run"; - "${modifier}+e" = "layout toggle split"; - "${modifier}+f" = "fullscreen toggle"; - "${modifier}+h" = "split h"; - "${modifier}+n" = "workspace next"; - "${modifier}+b" = "workspace prev"; - "${modifier}+r" = "mode resize"; - "${modifier}+s" = "layout stacking"; - "${modifier}+t" = "exec ${config.defaultApplications.fileManager}"; - "${modifier}+v" = "split v"; - "${modifier}+w" = "layout tabbed"; - "${modifier}+x" = "exec --no-startup-id ${new-workspace}"; - "${modifier}+y" = "exec ${config.defaultApplications.browser}"; - "XF86AudioLowerVolume" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -d 5 && pkill -RTMIN+3 i3blocks"; - "XF86AudioMute" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -t && pkill -RTMIN+3 i3blocks"; - "XF86AudioRaiseVolume" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -i 5 && pkill -RTMIN+3 i3blocks"; - }; -} + }]; + keybindings = { + "${modifier}+Down" = "focus down"; + "${modifier}+Left" = "focus left"; + "${modifier}+Return" = "exec ${config.defaultApplications.terminal}"; + "${modifier}+Right" = "focus right"; + "${modifier}+Shift+Down" = "move down"; + "${modifier}+Shift+Left" = "move left"; + "${modifier}+Shift+Right" = "move right"; + "${modifier}+Shift+Up" = "move up"; + "${modifier}+Shift+c" = "reload"; + "${modifier}+Shift+n" = "move window to workspace next"; + "${modifier}+Shift+b" = "move window to workspace prev"; + "${modifier}+Shift+q" = "kill"; + "${modifier}+Shift+r" = "restart"; + "${modifier}+Shift+w" = "exec ${pkgs.xautolock}/bin/xautolock -locknow"; + "${modifier}+Shift+x" = "exec --no-startup-id ${move-to-new-workspace}"; + "${modifier}+Shift+z" = "floating toggle"; + "${modifier}+Up" = "focus up"; + "${modifier}+a" = "exec ${pkgs.rofi}/bin/rofi -display-window — -show window"; + "${modifier}+d" = "exec ${pkgs.rofi}/bin/rofi -display-run — -show run"; + "${modifier}+e" = "layout toggle split"; + "${modifier}+f" = "fullscreen toggle"; + "${modifier}+h" = "split h"; + "${modifier}+n" = "workspace next"; + "${modifier}+b" = "workspace prev"; + "${modifier}+p" = "exec ${pkgs.rofi-pass}/bin/rofi-pass"; + "${modifier}+r" = "mode resize"; + "${modifier}+s" = "layout stacking"; + "${modifier}+t" = "exec ${config.defaultApplications.fileManager}"; + "${modifier}+v" = "split v"; + "${modifier}+w" = "layout tabbed"; + "${modifier}+x" = "exec --no-startup-id ${new-workspace}"; + "${modifier}+y" = "exec ${config.defaultApplications.browser}"; + "XF86AudioLowerVolume" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -d 5 && pkill -RTMIN+3 i3blocks"; + "XF86AudioMute" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -t && pkill -RTMIN+3 i3blocks"; + "XF86AudioRaiseVolume" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -i 5 && pkill -RTMIN+3 i3blocks"; + }; + } diff --git a/dot/vimrc b/dot/vimrc index d079ff5..5c1f9a3 100644 --- a/dot/vimrc +++ b/dot/vimrc @@ -11,6 +11,21 @@ colorscheme delek let mapleader = "," " let maplocalleader="\\" +noremap h :split +noremap v :vsplit +noremap gs :Gstatus +noremap gc :Gcommit +noremap n :bn +noremap p :bp +noremap c :bd + +" reindent whole file +noremap i mzgg=G`z + +nnoremap a (ale_hover) +nnoremap d (ale_go_to_definition_in_tab) +nnoremap rf (ale_find_references) + filetype plugin indent on set title set nocompatible @@ -93,7 +108,7 @@ if has("autocmd") autocmd bufnewfile,bufread *.h set keywordprg=man\ 3 autocmd bufnewfile,bufread *.nix packadd vim-nix | set filetype=nix autocmd bufnewfile,bufread *.rust packadd rust-vim | packadd deoplete-rust - autocmd bufnewfile,bufread *.csv packadd csv-vim + autocmd bufnewfile,bufread *.csv packadd csv-vim | set filetype=csv autocmd bufnewfile,bufread *.tex packadd vimtex | set filetype=tex autocmd bufnewfile,bufread *.ts packadd vim-typescript autocmd bufnewfile,bufread *.journal packadd vim-ledger | set filetype=ledger shiftwidth=4 @@ -102,7 +117,6 @@ if has("autocmd") autocmd bufnewfile,bufread *.dhall packadd dhall-vim | set filetype=dhall autocmd filetype haskell packadd haskell-vim autocmd filetype javascript packadd vim-javascript - autocmd filetype python packadd deoplete-jedi autocmd filetype make setlocal noexpandtab autocmd filetype html packadd emmet-vim autocmd bufreadpost * @@ -137,11 +151,14 @@ let g:haskell_enable_pattern_synonyms = 1 " if exists("g:loaded_ale") let g:ale_linters = { \ 'rust': ['cargo'], + \ 'css': ['csslint'], \ 'haskell': ['ghc', 'cabal-ghc', 'hlint'], \ 'html': ['tidy', 'proselint'], \ 'latex': ['lacheck', 'chktex', 'proselint'], \ 'pandoc': ['proselint'], \ 'ruby': ['rubocop'], + \ 'json': ['jsonlint'], + \ 'python': ['pyls'], \} let g:ale_fixers = { \ '*': ['remove_trailing_lines', 'trim_whitespace'], @@ -151,7 +168,6 @@ let g:ale_fixers = { \ 'css': ['prettier'], \ 'html': ['prettier'], \ 'markdown': ['prettier'], - \ 'pandoc': ['prettier'], \ 'json': ['jq'], \ 'python': ['black'], \ 'rust': ['rustfmt'] diff --git a/main.nix b/main.nix index c12a514..4f97f03 100644 --- a/main.nix +++ b/main.nix @@ -104,6 +104,10 @@ in { "mpv/input.conf".text = import dot/mpv.nix; "htop/htoprc".text = builtins.readFile dot/htoprc; "zathura/zathurarc".text = "set selection-clipboard clipboard"; + "pycodestyle".text = '' + [pycodestyle] + max-line-length = 110 + ''; }; home.file = { diff --git a/theme.nix b/theme.nix index 9779f8a..a636daf 100644 --- a/theme.nix +++ b/theme.nix @@ -66,8 +66,8 @@ in rec { black = "#000000"; gray = "#888888"; - colorScheme = solarizedDark; - invertedColorScheme = solarizedLight; + colorScheme = macOS; + invertedColorScheme = flip macOS; colorPalette = [ colorScheme.black.dark colorScheme.red.dark colorScheme.green.dark colorScheme.yellow.dark colorScheme.blue.dark colorScheme.magenta.dark colorScheme.cyan.dark colorScheme.white.dark