Neovim + XDG setup.

This commit is contained in:
Bartek Stalewski 2020-10-22 16:25:26 +02:00
parent ed7aa63a56
commit d64674a293
8 changed files with 43 additions and 56 deletions

View File

@ -1,17 +0,0 @@
*.swp
*~
.*history*
.cache
.config/vim
.config/zsh/caches
.config/zsh/plugins
.config/zsh/themes
.fdignore
.fzf*
.git*
.lesshst
.local
.python*
.ssh/known_hosts
.vim
.zcomp*

16
fd/ignore Normal file
View File

@ -0,0 +1,16 @@
*.swp
*~
.*history*
.cache
.config/nvim/runtime
.config/nvim/plugins
.config/zsh
nvim/runtime
nvim/plugins
zsh
.git*
.lesshst
.python*
.ssh/known_hosts
.vim
.zcomp*

View File

@ -1,47 +1,32 @@
#!/bin/sh
# cleaning & preparing
# cleaning
rm -rf ~/.bash* ~/.profile
rm -rf ~/.dotfiles
rm -rf ~/.config/fd ~/.config/git ~/.config/nvim ~/.config/tmux ~/.config/zsh ~/.zshrc
rm -rf ~/.fdignore ~/.fzf.bash ~/.fzf.zsh ~/.gitconfig ~/.gitignore ~/.history ~/.tmux.conf ~/.zcomp* ~/.zsh*
# repo + preparations
git clone https://github.com/ftpd/dotfiles.git ~/.dotfiles
mkdir -p ~/.config
mkdir -p ~/.cache ~/.config/local ~/.config/nvim ~/.config/zsh
## vim
# cleaning
rm -rf ~/.vim* ~/.config/vim
mkdir -p ~/.config/vim/runtime
# installing
ln -sf ~/.dotfiles/vim/autoload ~/.config/vim/runtime
ln -sf ~/.dotfiles/vim/vimrc ~/.vimrc
## neovim
mkdir -p ~/.config/nvim/runtime
ln -sf ~/.dotfiles/nvim/autoload ~/.config/nvim/runtime
ln -sf ~/.dotfiles/nvim/init.vim ~/.config/nvim/init.vim
## .gitignore
# cleaning
rm -rf ~/.gitignore
# installing
ln -sf ~/.dotfiles/conf/gitignore ~/.gitignore
git config --global core.excludesfile ~/.gitignore
ln -sf ~/.dotfiles/git ~/.config/
## .fdignore
# cleaning
rm -rf ~/.fdignore
# installing
ln -sf ~/.dotfiles/conf/fdignore ~/.fdignore
## fdignore
ln -sf ~/.dotfiles/fd ~/.config/
## tmux
# cleaning
rm -rf ~/.tmux.conf
# installing
ln -sf ~/.dotfiles/conf/tmux.conf ~/.tmux.conf
ln -sf ~/.dotfiles/tmux ~/.config/
## zsh
# cleaning
rm -rf ~/.zsh* ~/.zcomp* ~/.config/zsh/
mkdir -p ~/.config/zsh/caches ~/.config/zsh/plugins ~/.config/zsh/themes
# dependiences
mkdir -p ~/.cache/zsh ~/.config/zsh/caches ~/.config/zsh/plugins ~/.config/zsh/themes
git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.config/zsh/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.config/zsh/plugins/zsh-syntax-highlighting
git clone https://github.com/romkatv/powerlevel10k.git ~/.config/zsh/themes/powerlevel10k
# installing
ln -sf ~/.dotfiles/zsh/zshrc ~/.zshrc

View File

@ -1,31 +1,34 @@
export XDG_CONFIG_HOME=~/.config
export XDG_DATA_HOME=~/.cache
bindkey -e
autoload -U compinit && compinit -d ~/.config/zsh/caches/zcompdump
autoload -U promptinit && promptinit
autoload -U compinit && compinit -d $XDG_DATA_HOME/zsh/zcompdump
zstyle ':completion:*' menu select
zstyle ':completion:*' list-colors ''
zmodload zsh/complist
export HISTSIZE=10000
SAVEHIST=$HISTSIZE
HISTFILE=~/.history
HISTFILE=$XDG_DATA_HOME/zsh/history
setopt inc_append_history
setopt share_history
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export FZF_DEFAULT_COMMAND='fd -H -L --ignore-file ~/.config/local.fdignore'
export FZF_CTRL_T_COMMAND='fd -H -L --ignore-file ~/.config/local.fdignore'
[ -f $XDG_CONFIG_HOME/fzf/fzf.zsh ] && source $XDG_CONFIG_HOME/fzf/fzf.zsh
export FZF_DEFAULT_COMMAND='fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd'
export FZF_CTRL_T_COMMAND='fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd'
export FZF_DEFAULT_OPTS="-e --multi --layout=reverse --preview='bat --color=always --tabs=2 --style=plain --theme=gruvbox {}'"
export FZF_CTRL_R_OPTS="-e --layout=reverse --preview=''"
_fzf_compgen_path() {
fd -H -L --ignore-file ~/.config/local.fdignore . "$1"
fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd . "$1"
}
_fzf_compgen_dir() {
fd -H -L --ignore-file ~/.config/local.fdignore --type d . "$1"
fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd --type d . "$1"
}
source ~/.config/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source ~/.config/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source ~/.config/zsh/themes/powerlevel10k/powerlevel10k.zsh-theme
source $XDG_CONFIG_HOME/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source $XDG_CONFIG_HOME/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source $XDG_CONFIG_HOME/zsh/themes/powerlevel10k/powerlevel10k.zsh-theme
source ~/.dotfiles/zsh/p10k.zsh
[ -e ~/.config/local.zsh ] && source ~/.config/local.zsh
[ -e $XDG_CONFIG_HOME/local/zsh ] && source $XDG_CONFIG_HOME/local/zsh