Fish/nvim config

This commit is contained in:
Andrejus
2020-05-31 15:01:47 +01:00
parent 850fe75370
commit 66c0c25fbd
10 changed files with 63 additions and 49 deletions

View File

@@ -5,9 +5,11 @@ SHELL := /bin/bash
.PHONY: clean
all:
# Install dotfiles
./bootstrap.sh
clean:
# Remove all temporary files and artefacts
rm -rf .dotlock tmp
# ---------------------------------------------------------------------------- #

View File

@@ -79,6 +79,5 @@ if ! shopt -oq posix; then
fi
fi
export NVM_DIR="$HOME/.config/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion

View File

@@ -1,5 +1,4 @@
if [ -z "$PROFILE_LOCK" ]; then
echo "acquiring profile lock"
export PROFILE_LOCK=1
# set PATH so it includes user's private bin if it exists
@@ -53,10 +52,4 @@ if [ -z "$PROFILE_LOCK" ]; then
export PATH="$YARN_DIR/bin:$PATH"
fi
# if ! [ -x "$(command -v yarn)" ]; then
# export PATH="$YARN_DIR/bin:$PATH"
# else
# export PATH="$(yarn global bin):$PATH"
# fi
fi

View File

@@ -1,37 +1,12 @@
# ---------------------------------------------------------------------------- #
# Cross-shell
# Cross-shell (only import if environment has been setup)
# ---------------------------------------------------------------------------- #
# # config
# set XDG_CONFIG_HOME $HOME/.config
# # workspace
# set WORKSPACE $HOME/workspace
# # .local
# set -x PATH $HOME/.local/bin $PATH
# # pyenv
# set PYENV_ROOT $HOME/.pyenv
# set -x PATH $PYENV_ROOT/bin $PATH
# set -x PATH $PYENV_ROOT/shims $PATH
# type -q pyenv && pyenv init - | source
# # poetry
# set POETRY_ROOT $HOME/.poetry
# set -x PATH $POETRY_ROOT/bin $PATH
# # nvm
# set NVM_ROOT $HOME/.nvm
# set -x PATH $NVM_ROOT/bin $PATH
# # yarn
# set YARN_DIR $HOME/.yarn
# set -x PATH $YARN_DIR/bin $PATH
if test -e ~/.profile
bass source ~/.profile
bass source "$NVM_DIR/nvm.sh" --no-use ';' nvm use iojs
end
# ---------------------------------------------------------------------------- #
# Fish specific
# ---------------------------------------------------------------------------- #
# Wipe greeting
set fish_greeting

View File

@@ -1,2 +1,2 @@
rafaelrinaldi/pure
jorgebucaran/fish-nvm
edc/bass

View File

@@ -5,4 +5,6 @@ bash_target="$HOME"
link_folder "$bash_source" "$bash_target"
echo "bash dotfiles are linked"
sudo chmod -R 0644 /etc/update-motd.d/
bash --version

View File

@@ -9,15 +9,6 @@ if not_installed "fish"; then
fi
echo "fish is installed"
# current_shell="$(getent passwd $USER | cut -d: -f7)"
# fish_path="$(which fish)"
# if [ "$current_shell" != "$fish_path" ]; then
# echo "setting fish as default, current shell was $current_shell"
# sudo chsh -s "$fish_path" "$USER"
# sudo usermod -s "$fish_path" "$USER"
# fi
# echo "fish is default login shell"
fish_source="$dotfiles_dir/fish"
fish_target="$XDG_CONFIG_HOME/fish"
link_folder "$fish_source" "$fish_target"
@@ -31,7 +22,7 @@ if ! [ -f "$fisher_location" ]; then
curl https://git.io/fisher --create-dirs -sLo "$fisher_location"
fi
echo "fisher is installed, updating..."
fish -c "fisher"
sh -c 'env HOME=$(mktemp -d) fish -c "fisher"'
fish -c "fisher --version"

13
install/05-vim.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
vim_source="$dotfiles_dir/vim"
vim_target="$XDG_CONFIG_HOME/nvim"
link_folder "$vim_source" "$vim_target"
echo "vim dotfiles are linked"
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
nvim -E PlugInstall -c q
nvim --version

View File

@@ -9,6 +9,8 @@ if not_installed "nvm"; then
run "https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh" \
"bash"
source "$NVM_DIR/nvm.sh"
nvm alias default lts
nvm default
fi

37
vim/init.vim Normal file
View File

@@ -0,0 +1,37 @@
set termguicolors
call plug#begin()
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-fugitive'
Plug 'APZelos/blamer.nvim'
Plug 'tpope/vim-surround'
if has('nvim')
Plug 'Shougo/denite.nvim', { 'do': ':UpdateRemotePlugins' }
else
Plug 'Shougo/denite.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
endif
call plug#end()
" Define mappings
autocmd FileType denite call s:denite_my_settings()
function! s:denite_my_settings() abort
nnoremap <silent><buffer><expr> <CR>
\ denite#do_map('do_action')
nnoremap <silent><buffer><expr> d
\ denite#do_map('do_action', 'delete')
nnoremap <silent><buffer><expr> p
\ denite#do_map('do_action', 'preview')
nnoremap <silent><buffer><expr> q
\ denite#do_map('quit')
nnoremap <silent><buffer><expr> i
\ denite#do_map('open_filter_buffer')
nnoremap <silent><buffer><expr> <Space>
\ denite#do_map('toggle_select').'j'
endfunction