Adopt use of NNN instead of NerdTree and add some aliases

This commit is contained in:
mitchell 2021-10-28 12:21:25 -04:00
parent fbe9eb511e
commit 517bc5f587
5 changed files with 77 additions and 33 deletions

View File

@ -16,6 +16,7 @@ function btre -a device -d 'Reconnect to a known bluetooth device'
bluetoothctl pair $devices[$index] bluetoothctl pair $devices[$index]
bluetoothctl trust $devices[$index] bluetoothctl trust $devices[$index]
bluetoothctl connect $devices[$index] bluetoothctl connect $devices[$index]
sleep 2
pkill bluetoothctl pkill bluetoothctl
end end

View File

@ -2,6 +2,7 @@ function define_aliases -a uname -d 'Defines aliases for commonly used commands'
alias rcp 'rsync -aP' alias rcp 'rsync -aP'
alias dm 'docker-machine' alias dm 'docker-machine'
alias v 'nvim +FZF' alias v 'nvim +FZF'
alias j 'joplin'
alias vg 'vagrant' alias vg 'vagrant'
alias tf 'terraform' alias tf 'terraform'
alias tocb 'xclip -in -selection clipboard' alias tocb 'xclip -in -selection clipboard'

View File

@ -0,0 +1,36 @@
# Rename this file to match the name of the function
# e.g. ~/.config/fish/functions/n.fish
# or, add the lines to the 'config.fish' file.
function n --wraps nnn --description 'support nnn quit and change directory'
# Block nesting of nnn in subshells
if test -n "$NNNLVL"
if [ (expr $NNNLVL + 0) -ge 1 ]
echo "nnn is already running"
return
end
end
# The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set)
# To cd on quit only on ^G, remove the "-x" as in:
# set NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
# NOTE: NNN_TMPFILE is fixed, should not be modified
if test -n "$XDG_CONFIG_HOME"
set -x NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
else
set -x NNN_TMPFILE "$HOME/.config/nnn/.lastd"
end
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
# stty start undef
# stty stop undef
# stty lwrap undef
# stty lnext undef
nnn -de $argv
if test -e $NNN_TMPFILE
source $NNN_TMPFILE
rm $NNN_TMPFILE
end
end

19
.vimrc
View File

@ -3,30 +3,30 @@ call plug#begin('~/.vim/plugged')
" Contains lots of sensible configurations, which I have in turn omitted from this file " Contains lots of sensible configurations, which I have in turn omitted from this file
Plug 'tpope/vim-sensible' Plug 'tpope/vim-sensible'
" Always enabled, non-language plugins
Plug 'tpope/vim-eunuch' Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-surround' Plug 'tpope/vim-surround'
Plug 'tpope/vim-endwise' Plug 'tpope/vim-endwise'
Plug 'w0rp/ale'
Plug 'morhetz/gruvbox'
Plug 'itchyny/lightline.vim' Plug 'itchyny/lightline.vim'
Plug 'edkolev/tmuxline.vim' Plug 'edkolev/tmuxline.vim'
Plug 'airblade/vim-gitgutter' Plug 'airblade/vim-gitgutter'
Plug 'vimwiki/vimwiki' Plug 'vimwiki/vimwiki'
Plug 'junegunn/goyo.vim' Plug 'junegunn/goyo.vim'
Plug 'junegunn/fzf' Plug 'junegunn/fzf'
Plug 'reedes/vim-pencil', { 'on': ['HardPencil', 'SoftPencil'] }
if !exists('g:vscode')
Plug 'morhetz/gruvbox'
Plug 'w0rp/ale'
Plug 'autozimu/LanguageClient-neovim', { Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next', \ 'branch': 'next',
\ 'do': 'bash install.sh', \ 'do': 'bash install.sh',
\ } \ }
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
" Conditionally loaded plugins
Plug 'tpope/vim-fugitive', { 'on': ['G', 'Git'], 'for': 'gitcommit' } Plug 'tpope/vim-fugitive', { 'on': ['G', 'Git'], 'for': 'gitcommit' }
Plug 'mileszs/ack.vim', { 'on': 'Ack' } Plug 'mileszs/ack.vim', { 'on': 'Ack' }
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'reedes/vim-pencil', { 'on': ['HardPencil', 'SoftPencil'] } Plug 'mcchrish/nnn.vim', { 'on': 'NnnPicker' }
Plug 'junegunn/limelight.vim', { 'on': 'Limelight' } Plug 'junegunn/limelight.vim', { 'on': 'Limelight' }
" Language specific plugins " Language specific plugins
@ -46,6 +46,7 @@ Plug 'b4b4r07/vim-hcl'
Plug 'hashivim/vim-terraform' Plug 'hashivim/vim-terraform'
Plug 'PProvost/vim-ps1' Plug 'PProvost/vim-ps1'
Plug 'vmchale/dhall-vim' Plug 'vmchale/dhall-vim'
endif
call plug#end() call plug#end()
@ -81,7 +82,7 @@ nmap <leader>c <Plug>(lcn-code-lens-action)
nmap <leader>d <Plug>(lcn-explain-error) nmap <leader>d <Plug>(lcn-explain-error)
nnoremap <leader>ls :LanguageClientStop<cr> nnoremap <leader>ls :LanguageClientStop<cr>
nnoremap <leader>ll :LanguageClientStart<cr> nnoremap <leader>ll :LanguageClientStart<cr>
nnoremap <leader>n :NERDTreeToggle<cr> nnoremap <leader>n :NnnPicker<cr>
nnoremap <leader>p :FZF<cr> nnoremap <leader>p :FZF<cr>
nnoremap <leader>a :Ack<cr> nnoremap <leader>a :Ack<cr>
nnoremap <leader>we :VimwikiAll2HTML<cr> nnoremap <leader>we :VimwikiAll2HTML<cr>
@ -109,6 +110,7 @@ let g:LanguageClient_serverCommands = {
\ 'typescript': ['typescript-language-server', '--stdio'], \ 'typescript': ['typescript-language-server', '--stdio'],
\ 'typescript.tsx': ['typescript-language-server', '--stdio'], \ 'typescript.tsx': ['typescript-language-server', '--stdio'],
\ 'elixir': ['~/code/elixir-lsp/elixir-ls/bin/language_server.sh'], \ 'elixir': ['~/code/elixir-lsp/elixir-ls/bin/language_server.sh'],
\ 'eelixir': ['~/code/elixir-lsp/elixir-ls/bin/language_server.sh'],
\ 'go': ['gopls'], \ 'go': ['gopls'],
\ 'fsharp': ['dotnet', '~/code/fsprojects/fsharp-language-server/bin/FSharpLanguageServer.dll'], \ 'fsharp': ['dotnet', '~/code/fsprojects/fsharp-language-server/bin/FSharpLanguageServer.dll'],
\ 'dhall': ['dhall-lsp-server'], \ 'dhall': ['dhall-lsp-server'],
@ -169,6 +171,9 @@ let g:pencil#map#suspend_af = 'K'
let g:vimwiki_list = [{'path': expand('~/.wiki/')}] let g:vimwiki_list = [{'path': expand('~/.wiki/')}]
let g:nnn#layout = {'left': '~20%'}
let g:nnn#command = 'nnn -eHo'
augroup ft_jsx augroup ft_jsx
au! au!
autocmd BufNewFile,BufRead *.jsx set filetype=javascript.jsx autocmd BufNewFile,BufRead *.jsx set filetype=javascript.jsx

View File

@ -62,6 +62,7 @@ function provision_terminal_env -d 'Install base terminal utilities and sync con
curl \ curl \
kitty-terminfo \ kitty-terminfo \
fzf \ fzf \
nnn
set -l arch_pkgs \ set -l arch_pkgs \
$base_pkgs \ $base_pkgs \