🚧 Vastly revamped nvim with fzf and ripgrep
This commit is contained in:
parent
3b851eaefe
commit
22856a2223
7 changed files with 189 additions and 22 deletions
|
|
@ -184,7 +184,6 @@ export PS1='\[\033[01;34m\][\u@\h\[\033[01;37m\] \W\[\033[01;34m\]]\$\033[01;34m
|
||||||
eval "$(thefuck --alias)"
|
eval "$(thefuck --alias)"
|
||||||
export PATH="$PATH:$GOPATH/bin:/home/brian/scripts:/home/brian/.local/bin:/home/brian/.local/share/nvim/lsp_servers"
|
export PATH="$PATH:$GOPATH/bin:/home/brian/scripts:/home/brian/.local/bin:/home/brian/.local/share/nvim/lsp_servers"
|
||||||
export GREP_COLORS='ms=01;34'
|
export GREP_COLORS='ms=01;34'
|
||||||
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
|
|
||||||
|
|
||||||
# icons-in-terminal
|
# icons-in-terminal
|
||||||
# source ~/.local/share/icons-in-terminal/icons_bash.sh
|
# source ~/.local/share/icons-in-terminal/icons_bash.sh
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,19 @@ end
|
||||||
-- Enable quick-lint-js
|
-- Enable quick-lint-js
|
||||||
require('lspconfig/quick_lint_js').setup {}
|
require('lspconfig/quick_lint_js').setup {}
|
||||||
|
|
||||||
|
-- Enable use of ripgrep
|
||||||
|
require('nvim-ripgrep').setup{
|
||||||
|
runner = require('nvim-ripgrep.run').ripgrep, -- grep command
|
||||||
|
prompt = "❯ ", -- prompt
|
||||||
|
window = {
|
||||||
|
width = 0.8,
|
||||||
|
border = "rounded",
|
||||||
|
};
|
||||||
|
open_qf_fn = function()
|
||||||
|
return vim.api.nvim_command('copen')
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
-- quick-lint-js detects errors in insert mode
|
-- quick-lint-js detects errors in insert mode
|
||||||
vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(
|
vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(
|
||||||
vim.lsp.diagnostic.on_publish_diagnostics, {
|
vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,9 @@ keymap('n', '<a-right>', '<c-w>:tabnext<CR>', {})
|
||||||
-- Use ctrl- [hl] to select the active split!
|
-- Use ctrl- [hl] to select the active split!
|
||||||
keymap('n', '<c-h>', '<c-w>:wincmd h<CR>', {}) keymap('n', '<c-l>', '<c-w>:wincmd l<CR>', {})
|
keymap('n', '<c-h>', '<c-w>:wincmd h<CR>', {}) keymap('n', '<c-l>', '<c-w>:wincmd l<CR>', {})
|
||||||
|
|
||||||
|
-- open fzf
|
||||||
|
keymap('n', '<c-p>', '<c-w>:Files<CR>', {})
|
||||||
|
|
||||||
-- Toggle NERDCommenter with Ctrl + c
|
-- Toggle NERDCommenter with Ctrl + c
|
||||||
vim.cmd[[:map <C-c> <Plug>NERDCommenterToggle]]
|
vim.cmd[[:map <C-c> <Plug>NERDCommenterToggle]]
|
||||||
|
|
||||||
|
|
@ -52,3 +55,4 @@ vim.cmd[[noremap <silent> <expr> k (v:count == 0 ? 'gk' : 'k')]]
|
||||||
-- Toggle English spellcheck with F11
|
-- Toggle English spellcheck with F11
|
||||||
vim.cmd[[nnoremap <silent> <F11> :set spell!<cr>]]
|
vim.cmd[[nnoremap <silent> <F11> :set spell!<cr>]]
|
||||||
vim.cmd[[inoremap <silent> <F11> <C-O>:set spell!<cr>]]
|
vim.cmd[[inoremap <silent> <F11> <C-O>:set spell!<cr>]]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,8 @@ require('packer').startup(function()
|
||||||
use 'mattn/emmet-vim'
|
use 'mattn/emmet-vim'
|
||||||
use 'norcalli/nvim-colorizer.lua'
|
use 'norcalli/nvim-colorizer.lua'
|
||||||
use 'airblade/vim-gitgutter'
|
use 'airblade/vim-gitgutter'
|
||||||
use 'ctrlpvim/ctrlp.vim' -- fuzzy find files
|
-- use 'ctrlpvim/ctrlp.vim' -- decent fuzzy find files
|
||||||
|
use 'junegunn/fzf.vim' -- better fuzzy find files
|
||||||
use 'preservim/nerdcommenter'
|
use 'preservim/nerdcommenter'
|
||||||
use 'prettier/vim-prettier'
|
use 'prettier/vim-prettier'
|
||||||
use {'lewis6991/gitsigns.nvim'}
|
use {'lewis6991/gitsigns.nvim'}
|
||||||
|
|
|
||||||
167
nvim_custom_keys.txt
Normal file
167
nvim_custom_keys.txt
Normal file
|
|
@ -0,0 +1,167 @@
|
||||||
|
NOTES ON NEOVIM AND MY PERSONAL NEOVIM WORKFLOW
|
||||||
|
|
||||||
|
FOR OFFICIAL DOCUMENTATION OF NEOVIM, PLEASE VISIT THEIR GITHUB: https://github.com/neovim/neovim
|
||||||
|
|
||||||
|
I have created this small txt file to document my basic neoneovim work flow
|
||||||
|
It is combined with notes about my espanso keybindings, which are meant to aid in the workflow
|
||||||
|
Keep in mind these are specific to my neovim setup and will definitely not work in all neovim setups
|
||||||
|
|
||||||
|
-- Standard keybindings (all neovim)
|
||||||
|
|
||||||
|
NORMAL MODE
|
||||||
|
|
||||||
|
h - go one character left (prepend with a number to go that many characters)
|
||||||
|
j - go one character down (prepend with a number to go that many characters)
|
||||||
|
k - go one character up (prepend with a number to go that many characters)
|
||||||
|
l - go one character right (prepend with a number to go that many characters)
|
||||||
|
w - go to the right to the beginning of the next word (delimited by spaces)
|
||||||
|
b or shift b - go to the left to the beginning of the last word (delimited by spaces)
|
||||||
|
e or shift e - go to the right to the ending of the next word (delimited by spaces)
|
||||||
|
0 - go to beginning of line (prepend with a number to go that many characters)
|
||||||
|
$ - go to the end of the line (prepend with a number to go that many characters)
|
||||||
|
gg - go to top of the page
|
||||||
|
shift + g - go to the bottom of the page
|
||||||
|
ctrl u -page up
|
||||||
|
ctrl d - page down
|
||||||
|
/ - forwards slash searches foor the word/term you wish to jump to, just press enter once it is highlighted
|
||||||
|
:w - writes (my nneovim setup as autosave, but it's still a good feature to have)
|
||||||
|
:q - quits neovim (first neovim command to learn)
|
||||||
|
u - undoes last change (can be used with prepended numbers depending on how many steps you want to undo)
|
||||||
|
ctrl + r - reverts changes over after unintentional undoing (undoes the last undo commands, also can be prepended by a number)
|
||||||
|
|
||||||
|
d - beginning d keybinding, can be combined with many of the above commands (it cuts, so you can paste it using p keybinding)
|
||||||
|
(can be prepended by a number, and multiples the amount of words/lines is deleted/cut)
|
||||||
|
dh - delete word one back (equivalent to db)
|
||||||
|
dj - delete one line down
|
||||||
|
dk - delete one line up
|
||||||
|
dl - delete word one forward (equivlanet to dw)
|
||||||
|
dd - delete current line
|
||||||
|
d0 - delete from current cursor position to the beginning of the line
|
||||||
|
d$ - delete from the current cursor position to the end of the line
|
||||||
|
dgg - delete from the current cursor position to the beginning of the document
|
||||||
|
dG - delete from the current position to the end of the document
|
||||||
|
dw - delete word on current position
|
||||||
|
de - delete current cursor position to the end of the word
|
||||||
|
db - delete current cursor position to the beginning of the word
|
||||||
|
x - delete character under current cursor position
|
||||||
|
|
||||||
|
interesting use case:
|
||||||
|
di( - will delete everything encapsulated in the following parenthesis
|
||||||
|
di{ - will delete everything encapsulated in the following curly brackets
|
||||||
|
di[ - will delte everything encapsulated in the following square brackets
|
||||||
|
|
||||||
|
y - beginning y keybinding, yanks or copies character or word for pasting elsewhere using the p keybinding
|
||||||
|
(can be prepended by a number, and multiples the amount of words/lines to be copied)
|
||||||
|
yh - copies one word back (equivalent to yb)
|
||||||
|
yj - copies one line down
|
||||||
|
yk - copies one line up
|
||||||
|
yl - copies one word forward (equivlanet to ye)
|
||||||
|
ye - copies one word forward
|
||||||
|
yb - copies one word back
|
||||||
|
yy - copies entire line
|
||||||
|
yw - copies entire word
|
||||||
|
y0 - copies from current cursor position to beginning of line
|
||||||
|
y$ - copies from current cursor position to end of line
|
||||||
|
yG - copies from current cursor position to the end of document
|
||||||
|
ygg - copies from current cursor position to the beginning of document
|
||||||
|
|
||||||
|
FROM NORMAL MODE, ENTERING OTHER MODES
|
||||||
|
i - enter INSERT mode at the current cursor position
|
||||||
|
a - enter INSERT mode at the following cursor position (appending)
|
||||||
|
shift + i - enter INSERT mode at the beginning of the line
|
||||||
|
shift + a - enter INSERT mode at the end of the line
|
||||||
|
v - enter VISUAL mode
|
||||||
|
shift -v enter VISUAL mode and select the current line
|
||||||
|
ctrl + v - enter VISUAL BLOCK MODE
|
||||||
|
|
||||||
|
NO MATTER WHAT MODE YOU'RE IN, you can always:
|
||||||
|
<ESC> to return to NORMAL MODE
|
||||||
|
|
||||||
|
INSERT MODE
|
||||||
|
|
||||||
|
tab - configured for four spaces in my case
|
||||||
|
|
||||||
|
VISUAL MODE
|
||||||
|
|
||||||
|
h,j,k,l,g,shift+g,0,$ all apply, it simply highlights them
|
||||||
|
and you can use standard and custom commands here that would normally apply in NORMAL mode
|
||||||
|
|
||||||
|
CTRL + V ENTERS VISUAL BLOCK MODE
|
||||||
|
I only really use this for muliple commenting out of lines
|
||||||
|
(ctrl + v + j or k and then ctrl+c to comment out code)
|
||||||
|
|
||||||
|
--Custom Keybindings
|
||||||
|
|
||||||
|
NORMAL MODE
|
||||||
|
|
||||||
|
CTRL + x removes highlighting from previous search results
|
||||||
|
|
||||||
|
CTRL + c Comment out line (use in conjunction with CTRL + V for multiple lines)
|
||||||
|
|
||||||
|
CTRL + j/k Enter Multi-Cursor (red cursor is NORMAL MODE< yellow cursor is INSERT MODE) (hit <ESC> to return to NORMAL MODE - might require hitting <ESC> multiple times)
|
||||||
|
|
||||||
|
SHIFT + m Open up Markdown Preview for .md files (mainly used for README.md)
|
||||||
|
|
||||||
|
CTRL + p Open fuzzy file finder like search application
|
||||||
|
|
||||||
|
:Neoformat Formats most code options (don't use with .c or .cpp files as there is another application i use for that)
|
||||||
|
|
||||||
|
cp alias for using ClangFormat C/C++ Formatter
|
||||||
|
|
||||||
|
CTRL + b : Open Nneovim Tree
|
||||||
|
in Nneovim Tree there are specific keybindings (most standard neovim keybindings work here as well):
|
||||||
|
a - creates new file (keep adding slashes to create directories or don't for regular files)
|
||||||
|
d - deletes file (hit y when prompted)
|
||||||
|
r - renames file (enter new name and hit enter)
|
||||||
|
|
||||||
|
/ search for a word in whichever document you have Open
|
||||||
|
|
||||||
|
CTRL + v open file in Nneovim Tree in new vertical workspace
|
||||||
|
(if more than 2 are open, Nneovim will ask which one you wish to open it next to, A or B or C etc)
|
||||||
|
|
||||||
|
CTRL + h Navigate to one vertical window to the left
|
||||||
|
CTRL + l Navigate to one vertical window to the right
|
||||||
|
|
||||||
|
CTRL + e to adjust window width (h and l will adjust width, just hit enter afterwards to adjust, opening and closing nneovim tree readjusts back to defaults)
|
||||||
|
|
||||||
|
CTRL + t open new tab
|
||||||
|
|
||||||
|
ALT + <right arrow> or <tab> goes to next tab
|
||||||
|
|
||||||
|
ALT + <left arrow> or SHIFT + <tab> goes to previous tab
|
||||||
|
|
||||||
|
SHIFT + S Aliased to global search and replace
|
||||||
|
|
||||||
|
SHIFT + T Runs jester unit tester on appropriate .test.js files
|
||||||
|
|
||||||
|
F11 Toggle Spellchecker
|
||||||
|
|
||||||
|
-- INSERT MODE
|
||||||
|
|
||||||
|
ii - equivaent to <ESC> key (return to normal mode from insert mode)
|
||||||
|
|
||||||
|
-- ESPANSO BASED commands
|
||||||
|
NOTE: Espanso can be used in conjunction for some powerful aliases in neovim (as well as other applications)
|
||||||
|
FURTHER NOTATION: Please note that espanso is capabale of a lot more than is featured here and I highly recommend coming up with further expamples as it has the potential to greatly increase workflow speed
|
||||||
|
SEE: https://espanso.org/
|
||||||
|
|
||||||
|
Here are just some of my favorite expanded texts
|
||||||
|
In NeoVim's INSERT MODE, simply type
|
||||||
|
|
||||||
|
:command-prepended-by-colon - expands to this
|
||||||
|
|
||||||
|
:cll - console.log()
|
||||||
|
:cle - console.error()
|
||||||
|
:clt - console.table()
|
||||||
|
:func - function () {}
|
||||||
|
:def - def():
|
||||||
|
:fn - pub fn () {}
|
||||||
|
:for - for (;;) {}
|
||||||
|
:while - while () {}
|
||||||
|
:do - do {} while ()
|
||||||
|
:if - if () {}
|
||||||
|
:elif - else if () {}
|
||||||
|
:else - else {}
|
||||||
|
:try - try {} catch(error) {}
|
||||||
|
:inc - #include
|
||||||
|
:$ - `${}`
|
||||||
20
updates.txt
20
updates.txt
|
|
@ -27,22 +27,8 @@ https://www.itechtics.com/windows-10-download-iso/
|
||||||
|
|
||||||
To understand google-font-installer(gfi): visit: https://github.com/lordgiotto/google-font-installer
|
To understand google-font-installer(gfi): visit: https://github.com/lordgiotto/google-font-installer
|
||||||
|
|
||||||
set a $PHONE env by putting your number into $HOME/.phone_number for textme script to work
|
create a .n_hidden file for xh and ph scripts (see scripts, you'll know what to do)
|
||||||
|
|
||||||
ThinkorSwim (once again) broke due to a java update, their installer script doesn't really work anymore, so never uninstall I guess? anywho, here's what you have to do now if it doesn't open:
|
Make sure you installed fzf from your official package manager as this will allow you to use it with nvim:
|
||||||
|
|
||||||
paru zulu-11-bin
|
doas pacman -S fzf
|
||||||
|
|
||||||
archlinux-java status
|
|
||||||
|
|
||||||
doas archlinux-java set zulu-11
|
|
||||||
|
|
||||||
And go ahead and open it up to test
|
|
||||||
|
|
||||||
Fixed inkscape (uncomment ignored packages (inkscape and popplers) from /etc/pacman.conf)
|
|
||||||
|
|
||||||
doas ln /usr/lib/inkscape/libinkscape_base.so /usr/lib/libinkscape_base.so
|
|
||||||
|
|
||||||
Install espeak
|
|
||||||
|
|
||||||
paru espeak
|
|
||||||
|
|
|
||||||
|
|
@ -55,9 +55,6 @@ export PATH="$PATH:$GOPATH/bin:/home/brian/scripts:/home/brian/.local/bin:/home/
|
||||||
# Configure grep output colors
|
# Configure grep output colors
|
||||||
export GREP_COLORS='ms=01;34'
|
export GREP_COLORS='ms=01;34'
|
||||||
|
|
||||||
# Enable fuzzy file finder
|
|
||||||
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
|
||||||
|
|
||||||
# Don't show completion until at least 1 character has been typed
|
# Don't show completion until at least 1 character has been typed
|
||||||
zstyle ':autocomplete:*' min-input 1
|
zstyle ':autocomplete:*' min-input 1
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue