diff --git a/README.md b/README.md index 1eda2ab..aeb3570 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,10 @@ These are my personal dotfiles. Free for personal use. Thanks to [@bebehei](http * sway (wayland: window manager) * i3 (xorg: window manager) (maybe outdated) +* neovim (nvim) + * replaces `vim` completely * vim - * forked off [vimrc](https://github.com/bebehei/vimrc/) + * used as fallback, in case neovim is not available * NerdTree, autocompletion * colored * [git diff integration](https://github.com/mhinz/vim-signify) diff --git a/bash/bashrc b/bash/bashrc index b065281..c803ba1 100755 --- a/bash/bashrc +++ b/bash/bashrc @@ -20,7 +20,7 @@ export NEWT_COLORS='root=black,black;window=black,black;border=white,black;listb alias reload=". ~/.bashrc" # Bind PageUp and PageDown to history search -if [ -n "$BASH_VERSION" -a -n "$PS1" ]; then +if [ -n "$BASH_VERSION" ] && [ -n "$PS1" ]; then bind '"\e[5~": history-search-backward' bind '"\e[6~": history-search-forward' fi diff --git a/git/gitconfig b/git/gitconfig index 735bded..8fe190e 100644 --- a/git/gitconfig +++ b/git/gitconfig @@ -8,10 +8,9 @@ email = account@buehler.rocks [merge] defaultToUpstream = true - tool = vimdiff + tool = nvim -d conflictstyle = zdiff3 [core] - editor = vim eol = native pager = delta || (diff-so-fancy | less --tabs=4 -RFX) quotepath = false @@ -32,6 +31,7 @@ ri = rebase --interactive rc = rebase --continue ra = rebase --abort + stauts = status [rerere] enabled = true autoupdate = true @@ -46,8 +46,8 @@ fetch = +refs/pull/*/head:refs/remotes/upstream/pull/* fetch = +refs/merge-requests/*/head:refs/remotes/upstream/merge-requests/* [diff] - tool = vimdiff - colorMoved = plain + tool = nvim -d + colorMoved = default algorithm = histogram mnemonicPrefix = true renames = true diff --git a/install.conf.yaml b/install.conf.yaml index 188ef43..6823f1a 100644 --- a/install.conf.yaml +++ b/install.conf.yaml @@ -41,9 +41,6 @@ ~/.profile.d/10-liquidprompt.sh: shell/liquidprompt.sh ~/.profile.d/20-aliases.sh: shell/aliases.sh ~/.profile.d/20-cd.sh: shell/cd.sh - ~/.profile.d/40-extract.sh: shell/extract.sh - ~/.profile.d/40-mysqlpw.sh: shell/mysqlpw.sh - ~/.profile.d/80-command-not-found.sh: shell/command-not-found.sh ~/.profile.d/81-fzf.sh: shell/fzf.sh ~/.profile.d/82-direnv.sh: shell/direnv.sh ~/.profile.d/90-keychain.sh: shell/keychain.sh diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 5ada03b..09f1e06 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,13 +1,14 @@ { "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, - "gitsigns.nvim": { "branch": "main", "commit": "42d6aed4e94e0f0bbced16bbdcc42f57673bd75e" }, + "gitsigns.nvim": { "branch": "main", "commit": "abf82a65f185bd54adc0679f74b7d6e1ada690c9" }, "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, "nvim-autopairs": { "branch": "master", "commit": "c2a0dd0d931d0fb07665e1fedb1ea688da3b80b4" }, "nvim-treesitter": { "branch": "main", "commit": "d19def46c112c26c17adeef88dd1253cc6d623a1" }, "nvim-web-devicons": { "branch": "master", "commit": "803353450c374192393f5387b6a0176d0972b848" }, - "onedark.nvim": { "branch": "master", "commit": "213c23ae45a04797572242568d5d51937181792d" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "remember.nvim": { "branch": "master", "commit": "85aff6dc0a5adab088ef6b9210585ded31c32c7b" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, - "telescope.nvim": { "branch": "master", "commit": "a8c2223ea6b185701090ccb1ebc7f4e41c4c9784" }, - "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" } + "telescope.nvim": { "branch": "master", "commit": "ad7d9580338354ccc136e5b8f0aa4f880434dcdc" }, + "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, + "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" } } diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua index e7b591e..429b59a 100644 --- a/nvim/lua/config/lazy.lua +++ b/nvim/lua/config/lazy.lua @@ -18,12 +18,10 @@ require("lazy").setup({ -- import your plugins { import = "plugins" }, }, - -- Configure any other settings here. See the documentation for more details. - -- colorscheme that will be used when installing plugins. - install = { colorscheme = { "onedark" } }, - -- automatically check for plugin updates + -- Check for plugin updates once a week checker = { enabled = true, + frequency = 3600 * 24 * 7, notify = false, }, -- disable luarocks diff --git a/nvim/lua/config/lualine.lua b/nvim/lua/config/lualine.lua index 8a17d9b..34e080e 100644 --- a/nvim/lua/config/lualine.lua +++ b/nvim/lua/config/lualine.lua @@ -1,6 +1,5 @@ require('lualine').setup { options = { icons_enabled = true, - theme = 'onedark' } } diff --git a/nvim/lua/plugins/onedark.lua b/nvim/lua/plugins/onedark.lua deleted file mode 100644 index f70dbdd..0000000 --- a/nvim/lua/plugins/onedark.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - "navarasu/onedark.nvim", - priority = 1000, -- make sure to load this before all the other start plugins - config = function() - require('onedark').setup { - style = 'warmer' - } - require('onedark').load() - end -} diff --git a/nvim/lua/plugins/remember.lua b/nvim/lua/plugins/remember.lua new file mode 100644 index 0000000..1abcaea --- /dev/null +++ b/nvim/lua/plugins/remember.lua @@ -0,0 +1,4 @@ +return { + 'vladdoster/remember.nvim', + opts = {}, +} diff --git a/nvim/lua/plugins/tokyonight.lua b/nvim/lua/plugins/tokyonight.lua new file mode 100644 index 0000000..93d87dd --- /dev/null +++ b/nvim/lua/plugins/tokyonight.lua @@ -0,0 +1,8 @@ +return { + "folke/tokyonight.nvim", + lazy = false, + priority = 1000, + config = function() + vim.cmd([[colorscheme tokyonight-moon]]) + end, +} diff --git a/shell/aliases.sh b/shell/aliases.sh index 183a59e..1534ac7 100755 --- a/shell/aliases.sh +++ b/shell/aliases.sh @@ -12,8 +12,14 @@ alias :qa="exit" alias :q!="exit" alias :qw="exit" -alias vim="vim -p" -alias vi="vim -p" +if [ -n "$(type nvim 2>/dev/null)" ]; then + alias vimdiff='nvim -d' + alias vim="nvim -p" + alias vi="nvim -p" +else + alias vim="vim -p" + alias vi="vim -p" +fi alias yt-dlp='yt-dlp -o "%(title)s.%(ext)s"' alias yt-audio='yt-dlp -o "%(title)s.%(ext)s" --extract-audio' @@ -48,13 +54,6 @@ if [ -n "$(type sudo 2>/dev/null)" ] && [ "$USER" != 'root' ]; then done unset sudo - #create sudo aliases WITH leading s - for sudo in ps vim chown chmod; - do - type $sudo > /dev/null 2>&1 && alias s$sudo="sudo $sudo"; - done - unset sudo - type pacman >/dev/null 2>&1 && pacman(){ local sudo_needed # Check if pacman has -S, -R or -U option diff --git a/shell/command-not-found.sh b/shell/command-not-found.sh deleted file mode 100755 index 13cd193..0000000 --- a/shell/command-not-found.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -# arch -if [ "${BASH_VERSION}" ] && [ -r /usr/share/doc/pkgfile/command-not-found.bash ]; then - # shellcheck source=/dev/null - . /usr/share/doc/pkgfile/command-not-found.bash -fi - -if [ "${ZSH_VERSION}" ] && [ -r /usr/share/doc/pkgfile/command-not-found.zsh ]; then - # shellcheck source=/dev/null - . /usr/share/doc/pkgfile/command-not-found.zsh -fi - diff --git a/shell/extract.sh b/shell/extract.sh deleted file mode 100755 index d3f3f19..0000000 --- a/shell/extract.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh - -x() { - for zipfile in "$@"; do - _x_extractor - if [ -f "$zipfile" ]; then - case "$zipfile" in - *.deb) - _x_extractor="ar x" ;; - *.tar.lrz) - _x_extractor="lrztar -d" ;; - *.lrz) - _x_extractor="lrunzip" ;; - *.tar.bz2) - _x_extractor="bsdtar xjf" ;; - *.bz2) - _x_extractor="bunzip2" ;; - *.tar.gz) - _x_extractor="bsdtar xzf" ;; - *.gz) - _x_extractor="gunzip" ;; - *.tar.xz) - _x_extractor="bsdtar Jxf" ;; - *.xz) - _x_extractor="xz -d" ;; - *.rar) - _x_extractor="unrar e" ;; - *.tar) - _x_extractor="bsdtar xf" ;; - *.tbz2) - _x_extractor="bsdtar xjf" ;; - *.tgz) - _x_extractor="bsdtar xzf" ;; - *.zip) - _x_extractor="unzip" ;; - *.Z) - _x_extractor="uncompress" ;; - *.7z) - _x_extractor="7z x" ;; - *) - echo "Cannot extract '$zipfile': No extractor for filetype known ..." >&2 - return 1 - ;; - esac - - if ! command -v "$(echo "$_x_extractor" | awk '{print $1}')" >/dev/null 2>/dev/null; then - echo "Cannot extract '$zipfile': Cannot find extractor '$(echo "$_x_extractor" | awk '{print $1}')'." >&2 - return 1 - fi - - echo "Extracting '$zipfile'..." >&2 - eval "$_x_extractor" "$zipfile" - - elif [ ! -e "$zipfile" ]; then - echo "Cannot extract '$zipfile': File does not exist!" - return 1 - else - echo "Cannot extract '$zipfile': Not a valid file!" - return 1 - fi - done -} diff --git a/shell/mysqlpw.sh b/shell/mysqlpw.sh deleted file mode 100755 index 9701e11..0000000 --- a/shell/mysqlpw.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -#The function will find the given user and search for a mysql-password -#in the home-directory, which will get printed out! -#arg1: user where to find a config-file -# if not given, it uses the current user in the $HOME and $USER-Variable - -mysqlpw() { - _mysqlpw_H=$HOME - _mysqlpw_U=$USER - - # use different user, if arg1 given - if [ -n "$1" ]; then - - # check if given user is even existing - if ! id "$1" >/dev/null 2>/dev/null; then - echo user "$1" not existing >&2 - return 1 - fi - - _mysqlpw_U=$1 - _mysqlpw_H=$(grep ^"$1": /etc/passwd | cut -d ":" -f 6) - - fi; - - _mysqlpw_cnf="$_mysqlpw_H/.my.cnf" - - if [ ! -e "$_mysqlpw_cnf" ]; then - echo "$_mysqlpw_cnf" not existing >&2 && return 1 - fi - - if [ ! -r "$_mysqlpw_cnf" ]; then - echo "$_mysqlpw_cnf" not readable >&2 && return 1 - fi - - _mysqlpw_PW=$( (grep "password=" "$_mysqlpw_cnf" || echo undefined) | cut -d "=" -f 2) - - echo MySQL-Password for user "$_mysqlpw_U" is "$_mysqlpw_PW" -} diff --git a/shell/paths.sh b/shell/paths.sh index 052e1b2..cd86352 100755 --- a/shell/paths.sh +++ b/shell/paths.sh @@ -15,17 +15,6 @@ appendpath () { appendpath ~/.local/bin appendpath ~/.bin -if which ruby >/dev/null 2>&1 && which gem >/dev/null 2>&1; then - appendpath "$(ruby -r rubygems -e 'puts Gem.user_dir')"/bin -fi - -# PERL cpan modules -appendpath "$HOME"/.perl/5/bin -export PERL5LIB="$HOME/.perl/5/lib/perl5:$PERL5LIB" -export PERL_LOCAL_LIB_ROOT="$HOME/.perl/5:$PERL_LOCAL_LIB_ROOT" -export PERL_MB_OPT="--install_base \"$HOME/.perl/5\"" -export PERL_MM_OPT="INSTALL_BASE=$HOME/.perl/5" - export GOPATH=$HOME/.go export GOBIN=$HOME/.gobin appendpath "$GOPATH"/bin diff --git a/shell/vars.sh b/shell/vars.sh index 8c6116e..49180d9 100755 --- a/shell/vars.sh +++ b/shell/vars.sh @@ -1,5 +1,10 @@ #!/bin/sh -export EDITOR=vim -export VISUAL=vim +if [ -n "$(type nvim 2>/dev/null)" ]; then + export EDITOR=nvim + export VISUAL=nvim +else + export EDITOR=vim + export VISUAL=vim +fi export BROWSER=firefox diff --git a/zsh/zshrc b/zsh/zshrc index ccf96a7..0919c53 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + # Path to your oh-my-zsh installation. export ZSH=~/.oh-my-zsh fpath=( ~/.zcomplete "${fpath[@]}" )