From 93b9d17c6b2c8f63b1d05205c6ec696d998f904c Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 4 Oct 2020 14:41:10 +0530 Subject: migrate to home-manager --- bash/.bash_aliases | 2 ++ bash/.bash_profile | 4 ---- bash/.bash_prompt | 20 ++++++++++++++++---- bash/.bashrc | 6 +++--- nvim/.config/nvim/coc-settings.json | 26 +++++++++++++++++++++++--- nvim/.config/nvim/ftplugin/wiki.vim | 1 + nvim/.config/nvim/init.vim | 6 ++++++ 7 files changed, 51 insertions(+), 14 deletions(-) create mode 100644 nvim/.config/nvim/ftplugin/wiki.vim diff --git a/bash/.bash_aliases b/bash/.bash_aliases index efecd71..60c1d93 100644 --- a/bash/.bash_aliases +++ b/bash/.bash_aliases @@ -23,3 +23,5 @@ alias ggp='git push' alias gl='git log -p --abbrev-commit --pretty=medium' alias glo='git log --pretty=oneline --abbrev-commit' alias gst='git status --short' + +alias pfetch='pfetch | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g"' diff --git a/bash/.bash_profile b/bash/.bash_profile index d7df6a9..6d8c25b 100644 --- a/bash/.bash_profile +++ b/bash/.bash_profile @@ -2,7 +2,3 @@ # Get the aliases and functions [ -f $HOME/.bashrc ] && . $HOME/.bashrc - - - -export PATH="$HOME/.poetry/bin:$PATH" diff --git a/bash/.bash_prompt b/bash/.bash_prompt index ca47d1d..eaeecb6 100755 --- a/bash/.bash_prompt +++ b/bash/.bash_prompt @@ -15,10 +15,10 @@ git_branch() { if [[ $git_status =~ $on_branch ]]; then local branch=${BASH_REMATCH[1]} - echo -ne "\001${cyn}\002 $branch\001${rst}\002" + echo -ne "\001${cyn}\002$branch\001${rst}\002" elif [[ $git_status =~ $on_commit ]]; then local commit=${BASH_REMATCH[1]} - echo -ne "\001${prp}\002 $commit\001${rst}\002" + echo -ne "\001${prp}\002$commit\001${rst}\002" fi } @@ -29,7 +29,7 @@ prompt_pwd() { echo "/" else path="$(echo $PWD | sed -e "s-$HOME/--g")" - echo -ne " \001${gry}\002$path/\001${rst}\002" + echo -ne "\001${gry}\002$path/\001${rst}\002" fi } @@ -37,7 +37,7 @@ rootornot() { if [[ "$(id -u)" -eq 0 ]]; then echo -ne "\001${red}\002#\001${rst}\002" else - echo -ne "$" + echo -ne "λ" fi } @@ -47,7 +47,19 @@ host() { fi } +in_nix() { + if [ "$IN_NIX_SHELL" == "impure" ]; then + echo -ne "\001${red}\002(nix)\001${rst}\002" + elif [ "$IN_NIX_SHELL" == "pure" ]; then + echo -ne "\001${grn}\002(nix)\001${rst}\002" + else + echo -ne "" + fi + +} + +# export PS1='\n$(prompt_pwd) $(git_branch)\n$(rootornot) ' export PS1='\n$(pista)' export PS2=" > " diff --git a/bash/.bashrc b/bash/.bashrc index 656978a..279a81a 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -2,11 +2,10 @@ export PATH=$PATH":$HOME/scripts" export TERM=xterm-256color-italic export EDITOR="/run/current-system/sw/bin/nvim" -export MANPAGER="less" +export MANPAGER="nvim +Man!" export BROWSER="/run/current-system/sw/bin/nvim" export GPG_TTY=$(tty) export TZ='Asia/Kolkata' -export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --color=bw' export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' @@ -53,7 +52,7 @@ fi [ -f $HOME/.github ] && . $HOME/.github [ -f ~/.bash_aliases ] && . ~/.bash_aliases -[ -f ~/.bash_prompt ] && . ~/.bash_prompt +# [ -f ~/.bash_prompt ] && . ~/.bash_prompt [ -f ~/.fzf.bash ] && source ~/.fzf.bash eval "$(stack --bash-completion-script stack)" @@ -110,3 +109,4 @@ export BRANCH_COLOR="bright black" # if HEAD ref peels to a commit (detached state) export COMMIT_COLOR="green" +eval "$(direnv hook bash)" diff --git a/nvim/.config/nvim/coc-settings.json b/nvim/.config/nvim/coc-settings.json index f211585..8515224 100644 --- a/nvim/.config/nvim/coc-settings.json +++ b/nvim/.config/nvim/coc-settings.json @@ -2,7 +2,7 @@ "suggest.timeout": 500, "coc.source.vimtex.enable": true, "coc.preferences.formatOnSaveFiletypes": [ - "dart", + "rust", "python" ], "coc.preferences.hoverTarget": "preview", @@ -13,6 +13,18 @@ "filetypes": ["sh"], "ignoredRootPaths": ["~"] }, + "nix": { + "command": "rnix-lsp", + "filetypes": ["nix"] + }, + "elmLS": { + "command": "elm-language-server", + "filetypes": ["elm"], + "rootPatterns": ["elm.json"], + "initializationOptions": { + "elmAnalyseTrigger": "never" + } + }, "ccls": { "command": "ccls", "filetypes": ["c", "cpp", "objc", "objcpp"], @@ -25,7 +37,7 @@ } }, "haskell": { - "command": "hie-wrapper", + "command": "hie", "args": ["--lsp"], "rootPatterns": [ "stack.yaml", @@ -52,11 +64,19 @@ "messageTarget": "float", "messageDelay": 150 }, + "python.pythonPath": "./env/python", "python.formatting.provider": "black", + "python.formatting.blackPath": "./env/black", + "python.linting.mypyEnabled": true, + "python.linting.mypyPath": "./env/mypy", + "python.linting.pylintEnabled": false, + "python.linting.pylamaEnabled": true, + "python.linting.pylamaPath": "./env/pylama", + "python.sortImports.path": "./env/isort", "python.jediEnabled": true, "rust-analyzer": { "serverPath": "/home/np/.nix-profile/bin/rust-analyzer", - "inlayHints.chainingHints": true, + "inlayHints.chainingHints": false, "procMacro.enable": true, "lruCapacity": 12 } diff --git a/nvim/.config/nvim/ftplugin/wiki.vim b/nvim/.config/nvim/ftplugin/wiki.vim new file mode 100644 index 0000000..88a5339 --- /dev/null +++ b/nvim/.config/nvim/ftplugin/wiki.vim @@ -0,0 +1 @@ +set textwidth=72 diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index 3d72490..d46bf88 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -13,6 +13,7 @@ Plug 'mattn/emmet-vim', {'for': ['javascript.jsx', 'html', 'css']} Plug 'neoclide/coc.nvim', {'do': { -> coc#util#install()}, 'branch': 'release'} Plug 'wellle/targets.vim' Plug 'editorconfig/editorconfig-vim' +Plug 'vimwiki/vimwiki' " tpope Plug 'tpope/vim-repeat' @@ -24,6 +25,7 @@ Plug 'tpope/vim-fugitive' Plug 'rust-lang/rust.vim', {'for': 'rust'} Plug 'lervag/vimtex', {'for': 'tex'} Plug 'neovimhaskell/haskell-vim', {'for': 'haskell'} +Plug 'elmcast/elm-vim' Plug 'LnL7/vim-nix' " colorschemes @@ -188,3 +190,7 @@ hi CocInfoFloat ctermfg=7 hi CocHintFloat ctermfg=7 hi CocRustChainingHint ctermfg=8 + +" elm-vim +let g:elm_setup_keybindings = 0 + -- cgit v1.2.3