nvim: remove config
This commit is contained in:
parent
6abc34b9f7
commit
8477ec14b8
@ -15,7 +15,6 @@ with import <nixpkgs> {}; [
|
|||||||
jq
|
jq
|
||||||
less
|
less
|
||||||
macchina
|
macchina
|
||||||
neovim
|
|
||||||
nix
|
nix
|
||||||
ripgrep
|
ripgrep
|
||||||
tldr
|
tldr
|
||||||
|
1
.config/nvim/.gitignore
vendored
1
.config/nvim/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
.netrwhist
|
|
@ -1,83 +0,0 @@
|
|||||||
" use Vim mode instead of pure Vi, must be the first instruction
|
|
||||||
" wrapped in conditional to avoid side effects when already set
|
|
||||||
if &compatible
|
|
||||||
set nocompatible
|
|
||||||
endif
|
|
||||||
|
|
||||||
" configure plugins using vim-plug
|
|
||||||
" https://github.com/junegunn/vim-plug
|
|
||||||
call plug#begin('~/.cache/nvim/plugged')
|
|
||||||
|
|
||||||
" helpers
|
|
||||||
Plug 'farmergreg/vim-lastplace' " intelligently reopen files at last edit position
|
|
||||||
Plug 'junegunn/fzf' " fuzzy finder
|
|
||||||
Plug 'junegunn/fzf.vim' " fuzzy finder for vim
|
|
||||||
Plug 'ntpeters/vim-better-whitespace' " highlight trailing whitespace, :StripWhitespace to remove
|
|
||||||
Plug 'PeterRincker/vim-searchlight' " highlight current search match differently
|
|
||||||
Plug 'tpope/vim-sensible' " defaults everyone can agree on
|
|
||||||
Plug 'tpope/vim-sleuth' " heuristically set buffer options
|
|
||||||
Plug 'vim-airline/vim-airline' " fancy statusline
|
|
||||||
|
|
||||||
" languages
|
|
||||||
Plug 'blankname/vim-fish' " fish
|
|
||||||
Plug 'rust-lang/rust.vim' " rust
|
|
||||||
Plug 'udalov/kotlin-vim' " kotlin
|
|
||||||
Plug 'ziglang/zig.vim' " zig
|
|
||||||
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
" Quickly edit/reload this configuration file
|
|
||||||
" To return to previous file, type ':edit #'
|
|
||||||
nnoremap gev :edit $MYVIMRC<Return>
|
|
||||||
nnoremap gsv :source $MYVIMRC<Return>
|
|
||||||
|
|
||||||
" hide line numbers at startup, toggle with F2
|
|
||||||
set nonumber norelativenumber
|
|
||||||
nnoremap <silent> <F2> :set number! relativenumber!<Return>
|
|
||||||
|
|
||||||
" highlight the cursor line, toggle with F3
|
|
||||||
nnoremap <silent> <F3> :set cursorline!<Return>
|
|
||||||
|
|
||||||
" show the effects of a command incrementally, as you type
|
|
||||||
set inccommand=nosplit
|
|
||||||
|
|
||||||
" clear highlighting with escape key
|
|
||||||
nnoremap <silent> <Esc> :noh<Return><Esc>
|
|
||||||
|
|
||||||
" fzf settings
|
|
||||||
let g:fzf_command_prefix = 'Fzf'
|
|
||||||
let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } }
|
|
||||||
nmap <Leader><Tab> <Plug>(fzf-maps-n)
|
|
||||||
xmap <Leader><Tab> <Plug>(fzf-maps-x)
|
|
||||||
omap <Leader><Tab> <Plug>(fzf-maps-o)
|
|
||||||
nnoremap <C-P> :FzfFiles<Return>
|
|
||||||
nnoremap fc :FzfCommits<Return>
|
|
||||||
nnoremap ff :FzfFiles<Return>
|
|
||||||
nnoremap fh :FzfHistory<Return>
|
|
||||||
nnoremap fr :FzfRg<Return>
|
|
||||||
|
|
||||||
" disable match highlighting
|
|
||||||
let g:loaded_matchparen=1
|
|
||||||
|
|
||||||
" write settings
|
|
||||||
set confirm " confirm :q in case of unsaved changes
|
|
||||||
|
|
||||||
" clipboard settings
|
|
||||||
set clipboard=unnamedplus " enable copy/paste/yank to and from Vim/Neovim
|
|
||||||
|
|
||||||
" disable cursor-styling
|
|
||||||
" https://github.com/neovim/neovim/wiki/FAQ#how-to-change-cursor-shape-in-the-terminal
|
|
||||||
set guicursor=
|
|
||||||
autocmd OptionSet guicursor noautocmd set guicursor=
|
|
||||||
|
|
||||||
" paste settings (in Neovim, use plain insert mode)
|
|
||||||
if !has('nvim')
|
|
||||||
set pastetoggle=<F3>
|
|
||||||
endif
|
|
||||||
|
|
||||||
" disable mouse support
|
|
||||||
" https://github.com/neovim/neovim/pull/19290
|
|
||||||
set mouse=
|
|
||||||
|
|
||||||
" associate Jenkinsfile with groovy syntax
|
|
||||||
autocmd BufNewFile,BufRead Jenkinsfile set filetype=groovy
|
|
28
README.md
28
README.md
@ -1,26 +1,18 @@
|
|||||||
## Config files
|
### Tools
|
||||||
|
|
||||||
| Tool | Description |
|
* [Homebrew](https://brew.sh/) (macOS)
|
||||||
| -------- | ----------- |
|
* [Nix](https://nixos.org) (Linux)
|
||||||
| Homebrew | Package management (Mac) |
|
* [Fish](https://fishshell.com/)
|
||||||
| Nix | Package management (Linux) |
|
* [Helix](https://helix-editor.com/)
|
||||||
| Fish | Shell |
|
|
||||||
| Git | Version control |
|
|
||||||
| Neovim | Editor |
|
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
Run the interactive installer for Mac/Linux: `./install.sh`
|
Run the interactive installer: `./install.sh`
|
||||||
|
|
||||||
Keep pressing `Enter` to accept every prompt in order.
|
|
||||||
|
|
||||||
```
|
```
|
||||||
> ./install.sh
|
> ./install.sh
|
||||||
Install package mananger? [Y/n]
|
Install package manager [Y/n]
|
||||||
Install packages? [Y/n]
|
Install packages [Y/n]
|
||||||
Set login shell? [Y/n]
|
Install symlinks [Y/n]
|
||||||
Create symlinks? [Y/n]
|
Install login shell [Y/n]
|
||||||
Install vim plugins? [Y/n]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Backups are created for existing files that get replaced.
|
|
||||||
|
13
install.sh
13
install.sh
@ -18,14 +18,13 @@ confirm() {
|
|||||||
|
|
||||||
# Install tools
|
# Install tools
|
||||||
if [[ "$OSTYPE" == linux-gnu* ]]; then
|
if [[ "$OSTYPE" == linux-gnu* ]]; then
|
||||||
confirm "Install Nix?" && "$ROOTDIR/install/install-nix.sh"
|
confirm "Install Nix" && "$ROOTDIR/install/install-nix.sh"
|
||||||
confirm "Install Nix packages?" && "$ROOTDIR/install/install-nix-packages.sh"
|
confirm "Install Nix packages" && "$ROOTDIR/install/install-nix-packages.sh"
|
||||||
elif [[ "$OSTYPE" == darwin* ]]; then
|
elif [[ "$OSTYPE" == darwin* ]]; then
|
||||||
confirm "Install Homebrew?" && "$ROOTDIR/install/install-brew.sh"
|
confirm "Install Homebrew" && "$ROOTDIR/install/install-brew.sh"
|
||||||
confirm "Install Homebrew packages?" && "$ROOTDIR/install/install-brew-packages.sh"
|
confirm "Install Homebrew packages" && "$ROOTDIR/install/install-brew-packages.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Extra steps
|
# Extra steps
|
||||||
confirm "Set login shell?" && "$ROOTDIR/install/install-shell.sh"
|
confirm "Install symlinks" && "$ROOTDIR/install/install-symlinks.sh"
|
||||||
confirm "Create symlinks?" && "$ROOTDIR/install/install-symlinks.sh"
|
confirm "Install login shell" && "$ROOTDIR/install/install-shell.sh"
|
||||||
confirm "Install vim plugins?" && "$ROOTDIR/install/install-vim-plugins.sh"
|
|
||||||
|
@ -16,7 +16,6 @@ brew install \
|
|||||||
helix \
|
helix \
|
||||||
less \
|
less \
|
||||||
macchina \
|
macchina \
|
||||||
neovim \
|
|
||||||
ripgrep \
|
ripgrep \
|
||||||
tree \
|
tree \
|
||||||
zoxide
|
zoxide
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
echo "***** INSTALL VIM PLUGINS *****"
|
|
||||||
|
|
||||||
if [ -x "/usr/local/bin/nvim" ]; then
|
|
||||||
VIM_PATH="/usr/local/bin/nvim"
|
|
||||||
elif [ -x "$HOME/.nix-profile/bin/nvim" ]; then
|
|
||||||
VIM_PATH="$HOME/.nix-profile/bin/nvim"
|
|
||||||
else
|
|
||||||
echo "Cannot find vim! Tried the following paths:"
|
|
||||||
echo " - /usr/local/bin/nvim"
|
|
||||||
echo " - $HOME/.nix-profile/bin/nvim"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
VIM_PLUG="$HOME/.local/share/nvim/site/autoload/plug.vim"
|
|
||||||
|
|
||||||
if [ -f "$VIM_PLUG" ]; then
|
|
||||||
echo "Updating vim plugin manager..."
|
|
||||||
echo "Updating vim plugins..."
|
|
||||||
$VIM_PATH --headless +PlugUpgrade +PlugUpdate +qall
|
|
||||||
else
|
|
||||||
echo "Installing vim plugin manager..."
|
|
||||||
curl -fsSL -o "$VIM_PLUG" --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
||||||
echo "Installing vim plugins..."
|
|
||||||
$VIM_PATH --headless +PlugInstall +qall
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo
|
|
Loading…
x
Reference in New Issue
Block a user