Fp abbreviations, kicad and nvim keymap docs
This commit is contained in:
parent
1ed61054f7
commit
eaebbca5b3
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
# Select your current theme here!
|
# Select your current theme here!
|
||||||
imports = [
|
imports = [
|
||||||
# ./rose-pine-dawn.nix
|
./rose-pine-dawn.nix
|
||||||
./ai.nix
|
# ./ai.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Requires me to manually turn targets on!
|
# Requires me to manually turn targets on!
|
||||||
|
|
|
@ -10,7 +10,9 @@
|
||||||
"library": {
|
"library": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"types": true,
|
"types": true,
|
||||||
"plugins": false,
|
"plugins": [
|
||||||
|
"scrap"
|
||||||
|
],
|
||||||
"runtime": true
|
"runtime": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,121 +8,219 @@
|
||||||
|
|
||||||
## Keybinds
|
## Keybinds
|
||||||
|
|
||||||
Table of my own keybinds. Here as documentation for myself. I am yet to include any of the keybinds for cmp here.
|
I feel like macro recording is a rare thing, so I moved it to `yq/yQ`. This frees up `q` as a "namespace" of sorts for other default vim keybinds I want to move out. For example, I use `J` for diagnostics, so I moved the default action from `J` to `qj`.
|
||||||
|
|
||||||
> Things written using italics are chords
|
> Things written using italics are chords
|
||||||
> (aka all the keys need to be pressed at the same time)
|
> (aka all the keys need to be pressed at the same time)
|
||||||
|
|
||||||
|
### Base
|
||||||
|
|
||||||
| Keybind | Description | Plugins |
|
| Keybind | Description | Plugins |
|
||||||
| ------------ | ----------------------------------- | ------------------ |
|
| ----------- | ------------------------------------------------ | ------- |
|
||||||
| _vs_ | Create vertical split | |
|
| \<leader>a | [A]lternate file | |
|
||||||
| _cp_ | Use system clipboard | |
|
| \<leader>rw | [R]eplace [w]ord under cursor in the entire file | |
|
||||||
| _jl_ | Save | |
|
| Q | [Q]uit all buffers | |
|
||||||
|
| [d | Previous [d]iagnostic | |
|
||||||
|
| d] | Next [d]iagnostic | |
|
||||||
|
| J | Hover over diagnostic | |
|
||||||
|
| qJ | Merge with next line | |
|
||||||
|
| \<leader>D | [D]iagnostic loclist | |
|
||||||
| _jk_ | Exit insert mode | |
|
| _jk_ | Exit insert mode | |
|
||||||
| _rw_ | Rename word under cursor | |
|
| _jo_ | Save file | |
|
||||||
| _\<leader>k_ | Insert digraph | |
|
| S-Enter | Newline without continuing comment | |
|
||||||
| _\<leader>a_ | Swap last 2 used buffers | |
|
|
||||||
| C-n | Open tree | nvim-tree |
|
### Textobjects
|
||||||
| _vc_ | Clear vimux window | vimux |
|
|
||||||
| _vl_ | Rerun last vimux command | vimux |
|
| Keybinds | Description | Plugins |
|
||||||
| _vp_ | Run command in another tmux pane | vimux |
|
| -------- | -------------------------- | ------- |
|
||||||
| C-hjkl | Navigation between vim & tmux panes | vim-tmux-navigator |
|
| aq | [A]round [q]uotes | |
|
||||||
| J | Show line diagnostics | lspconfig |
|
| iq | [I]nside [q]uotes | |
|
||||||
| K | Show hover info | lspconfig |
|
| aa | [A]round [a]phostrophes | |
|
||||||
| L | Signature help (?) | lspconfig |
|
| ia | [I]nside [a]phostrophes | |
|
||||||
| gD | Go to declaration | lspconfig |
|
| ar | [A]round squa[r]e brackets | |
|
||||||
| gd | Go to definition | lspconfig |
|
| ir | [I]nside squa[r]e brackets | |
|
||||||
| gi | Go to implementation | lspconfig |
|
|
||||||
| \<leader>rn | Rename | lspconfig |
|
### Treesitter
|
||||||
| \<leader>f | format | lspconfig |
|
|
||||||
| \<leader>ca | code actions | lspconfig |
|
| Keybinds | Description |
|
||||||
|
| -------- | ------------------------------- |
|
||||||
|
| ]f | Go to next [f]unction start |
|
||||||
|
| ]F | Go to next [f]unction end |
|
||||||
|
| [f | Go to previous [f]unction start |
|
||||||
|
| [F | Go to previous [f]unction end |
|
||||||
|
| ]c | Go to next [c]lass start |
|
||||||
|
| ]C | Go to next [c]lass end |
|
||||||
|
| [c | Go to previous [c]lass start |
|
||||||
|
| [C | Go to previous [c]lass end |
|
||||||
|
|
||||||
|
#### Textobjects
|
||||||
|
|
||||||
|
| Keybinds | Description |
|
||||||
|
| -------- | ------------------- |
|
||||||
|
| af | [A]round [f]unction |
|
||||||
|
| if | [I]nside [f]unction |
|
||||||
|
| ac | [A]round [c]lass |
|
||||||
|
| ic | [I]nside [c]lass |
|
||||||
|
|
||||||
### Telescope
|
### Telescope
|
||||||
|
|
||||||
|
The `<leader>f` workspace contains keybinds which search for a specific filetype.
|
||||||
|
|
||||||
| Keybind | Description | Plugins |
|
| Keybind | Description | Plugins |
|
||||||
| ----------- | ------------------------------ | ---------------------- |
|
| ----------- | ------------------------ | ---------------------- |
|
||||||
| Ctrl-P | Find files | |
|
| C-p | Find files | |
|
||||||
| Ctrl-F | Grep in project | |
|
| C-f | Grep in project | |
|
||||||
|
| C-F | Interactive file broswer | telescope-file-browser |
|
||||||
| \<leader>d | Diagnostics | lspconfig |
|
| \<leader>d | Diagnostics | lspconfig |
|
||||||
| \<leader>ca | Code actions | lspconfig |
|
|
||||||
| \<leader>t | Show builtin pickers | |
|
| \<leader>t | Show builtin pickers | |
|
||||||
| \<leader>s | Show symbols using tree-sitter | |
|
| \<leader>ft | Typescript Files | |
|
||||||
| \<leader>gj | List git commits | |
|
| \<leader>fl | Latex Files | |
|
||||||
| \<leader>gk | List git branches | |
|
| \<leader>fp | Purescript Files | |
|
||||||
| _jp_ | Interactive file broswer | telescope-file-browser |
|
|
||||||
| _ui_ | Insert unicode char | |
|
|
||||||
|
|
||||||
### Idris
|
### Cmp
|
||||||
|
|
||||||
> The idris and arpeggio plugins are implicit here
|
|
||||||
|
|
||||||
| Keybind | Description |
|
| Keybind | Description |
|
||||||
| ------- | ------------------- |
|
| ------- | ------------------------ |
|
||||||
| _isc_ | Case split |
|
| C-d | Scroll completion up |
|
||||||
| _imc_ | Make case |
|
| C-s | Scroll completion down |
|
||||||
| _iml_ | Make lemma |
|
| Enter | Accept current competion |
|
||||||
| _ies_ | Expression search |
|
|
||||||
| _igd_ | Generate definition |
|
|
||||||
| _irh_ | Refine hole |
|
|
||||||
| _iac_ | Add clause |
|
|
||||||
|
|
||||||
### Purescript
|
### Lsp
|
||||||
|
|
||||||
|
The lsp configuration introduces the namespace `<leader>w` used for workspace manipulation.
|
||||||
|
|
||||||
| Keybind | Description |
|
| Keybind | Description |
|
||||||
| ------- | ------------------------------------------- |
|
| ----------- | --------------------------- |
|
||||||
| _vb_ | Make tmux run spago build in sepearate pane |
|
| gd | [G]o to [d]efinition |
|
||||||
| _vt_ | Make tmux run spago test in separate pane |
|
| gr | [G]o to [r]eferences |
|
||||||
|
| gi | [G]o to [i]mplementation |
|
||||||
|
| K | Hover |
|
||||||
|
| L | Signature help |
|
||||||
|
| \<leader>c | [C]ode actions |
|
||||||
|
| \<leader>F | [F]ormat file |
|
||||||
|
| \<leader>li | [l]sp [i]nfo |
|
||||||
|
| \<leader>rn | [R]e[n]ame |
|
||||||
|
| \<leader>wa | [W]orkspace [a]dd folder |
|
||||||
|
| \<leader>wr | [W]orkspace [r]emove folder |
|
||||||
|
| \<leader>wl | [W]orkspace [l]ist folders |
|
||||||
|
|
||||||
### Nix
|
### Vimux
|
||||||
|
|
||||||
|
Vimux keybinds live in the `<leader>v` namespace. Most vimux keybinds are filetype specific.
|
||||||
|
|
||||||
| Keybind | Description |
|
| Keybind | Description |
|
||||||
| ------- | ------------------------------------ |
|
| ----------- | -------------------------- |
|
||||||
| _ug_ | Run nix-fetchgit on the current file |
|
| \<leader>vc | [V]imux clear |
|
||||||
|
| \<leader>vl | [V]imux rerun last |
|
||||||
|
| \<leader>vp | [V]imux prompt for command |
|
||||||
|
|
||||||
### Lean
|
### Luasnip
|
||||||
|
|
||||||
- Extra brackets: ⟨⟩
|
| Keybind | Description |
|
||||||
|
| ----------- | ---------------------------- |
|
||||||
|
| Tab | Jump to next placeholder |
|
||||||
|
| S-Tab | Jump to previous placeholder |
|
||||||
|
| \<leader>rs | [R]eload [s]nippets |
|
||||||
|
|
||||||
## Some cool vim keybinds I sometimes forget about
|
### Filetypes
|
||||||
|
|
||||||
Documentation for myself
|
General filetype local keybinds reside inside the `<leader>l` namespace.
|
||||||
|
|
||||||
|
#### Purescript
|
||||||
|
|
||||||
|
| Keybind | Description |
|
||||||
|
| ----------- | ------------------------- |
|
||||||
|
| \<leader>vb | [V]imux run spago [b]uild |
|
||||||
|
| \<leader>vt | [V]imux run spago [t]est |
|
||||||
|
|
||||||
|
#### Nix
|
||||||
|
|
||||||
|
| Keybind | Description |
|
||||||
|
| ----------- | ------------------------ |
|
||||||
|
| \<leader>lg | Update [g]it fetch calls |
|
||||||
|
|
||||||
|
#### Idris
|
||||||
|
|
||||||
|
Idris keybinds live in the `<leader>I` namespace.
|
||||||
|
|
||||||
|
| Keybind | Description |
|
||||||
|
| ----------- | ------------------- |
|
||||||
|
| \<leader>IC | Make [c]ase |
|
||||||
|
| \<leader>IL | Make [l]emma |
|
||||||
|
| \<leader>Ic | Add [c]lause |
|
||||||
|
| \<leader>Ie | [E]xpression search |
|
||||||
|
| \<leader>Id | Generate [d]ef |
|
||||||
|
| \<leader>Is | [S]plit case |
|
||||||
|
| \<leader>Ih | Refine [h]ole |
|
||||||
|
|
||||||
|
#### Lua
|
||||||
|
|
||||||
|
| Keybind | Description |
|
||||||
|
| ----------- | --------------------------------- |
|
||||||
|
| \<leader>lf | Run [f]ile |
|
||||||
|
| \<leader>ls | Import [f]ile and call .[s]etup() |
|
||||||
|
|
||||||
|
### Hydra
|
||||||
|
|
||||||
|
| Keybind | Description |
|
||||||
|
| ---------- | ------------------- |
|
||||||
|
| C-w | Enter [w]indow mode |
|
||||||
|
| \<leader>v | Enter [v]enn mode |
|
||||||
|
|
||||||
|
#### Window mode
|
||||||
|
|
||||||
|
| Keybind | Description |
|
||||||
|
| --------- | ---------------------------------------- |
|
||||||
|
| h/j/k/l | Move cursor by window in given direction |
|
||||||
|
| H/J/K/L | Move window in given direction |
|
||||||
|
| C-h/j/k/l | Resize window in given direction |
|
||||||
|
| = | Equalize |
|
||||||
|
| s | Split horizontally |
|
||||||
|
| v | Split vertically |
|
||||||
|
| o | Close all other |
|
||||||
|
| q | Close window |
|
||||||
|
| w/Esc | Exit window mode |
|
||||||
|
|
||||||
|
#### Venn mode
|
||||||
|
|
||||||
|
| Keybind | Description |
|
||||||
|
| ------- | --------------------------------- |
|
||||||
|
| H/J/K/L | Continue arrow in given direction |
|
||||||
|
| f | Surround selected region with box |
|
||||||
|
|
||||||
|
### Firenvim
|
||||||
|
|
||||||
|
The following keybinds are available only when running inside firenvim:
|
||||||
|
|
||||||
|
| Keybind | Description |
|
||||||
|
| ------- | ------------- |
|
||||||
|
| C-z | Expand window |
|
||||||
|
|
||||||
|
### Small plugin keybinds
|
||||||
|
|
||||||
| Keybind | Description | Plugins |
|
| Keybind | Description | Plugins |
|
||||||
| ------- | ----------------------- | ------- |
|
| ----------- | ----------------------------------- | -------------------- |
|
||||||
| zz | Center the current line | |
|
| gcc | Comment line | nvim-comment |
|
||||||
|
| gc | Comment selection | nvim-comment |
|
||||||
|
| C-g | Open neo[g]it | neogit |
|
||||||
|
| \<leader>yg | [Y]ank remote [g]it url | gitlinker |
|
||||||
|
| cs[a][b] | Change surrounding pair from a to b | vim-surround |
|
||||||
|
| ds[a] | Delete surrounding pair of a | vim-surround |
|
||||||
|
| ys[m][a] | Surround the motion m with a | vim-surround |
|
||||||
|
| S[a] | Surround selected code with a | vim-surround |
|
||||||
|
| s | Initialize forward [s]earch | leap |
|
||||||
|
| S | Initialize backwards [s]earch | leap |
|
||||||
|
| gs | Initialize other window [s]earch | leap |
|
||||||
|
| C-n | Open filetree | nvim-tree |
|
||||||
|
| \<leader>p | [P]aste imge from clipboard | clipboard-image.nvim |
|
||||||
|
| C-h/j/k/l | Navigate panes | vim-tmux-navigator |
|
||||||
|
|
||||||
## Important plugins I use the default mappins of
|
### Undocumented
|
||||||
|
|
||||||
- paperplanes
|
#### Iron.nvim
|
||||||
|
|
||||||
| Keybind | Description |
|
Iron.nvim commands rest in the `<leader>i` namespace. There is a lot of them, and I rarely use this plugin, so I won't document them here just yet.
|
||||||
| ------- | ------------------------- |
|
|
||||||
| :PP | Create pastebin-like link |
|
|
||||||
|
|
||||||
- nvim-comment
|
#### Magma
|
||||||
|
|
||||||
| Keybind | Description |
|
Magma commands live under the namespace `<leader>M`. I barely use this plugin, so I won't document my keybinds just yet.
|
||||||
| ------- | ----------------- |
|
|
||||||
| gcc | Comment line |
|
|
||||||
| gc | Comment selection |
|
|
||||||
|
|
||||||
- neogit
|
|
||||||
|
|
||||||
| Keybind | Description |
|
|
||||||
| ------- | ----------- |
|
|
||||||
| C-g | Open neogit |
|
|
||||||
|
|
||||||
- gitlinker
|
|
||||||
|
|
||||||
| Keybind | Description |
|
|
||||||
| ---------- | ------------------ |
|
|
||||||
| <leader>gy | Create remote link |
|
|
||||||
|
|
||||||
- nvim-surround
|
|
||||||
|
|
||||||
| Keybind | Description | Mode |
|
|
||||||
| -------- | ----------------------------------- | ---- |
|
|
||||||
| cs[a][b] | Change surrounding pair from a to b | n |
|
|
||||||
| ds[a] | Delete surrounding pair of a | n |
|
|
||||||
| ys[m][a] | Surround the motion m with a | n |
|
|
||||||
| S[a] | Surround selected code with a | v |
|
|
||||||
|
|
|
@ -15,3 +15,5 @@ vim.keymap.set(
|
||||||
)
|
)
|
||||||
|
|
||||||
vim.opt.expandtab = true -- Use spaces for the tab char
|
vim.opt.expandtab = true -- Use spaces for the tab char
|
||||||
|
|
||||||
|
require("my.abbreviations.fp")
|
||||||
|
|
|
@ -93,12 +93,8 @@ local abbreviations = {
|
||||||
{ "rref", "reduced row echalon form" },
|
{ "rref", "reduced row echalon form" },
|
||||||
}
|
}
|
||||||
|
|
||||||
---@type ExpansionOptions
|
|
||||||
local no_capitalization = { capitalized = false }
|
|
||||||
|
|
||||||
-- Todo: convert exponents and subscripts
|
-- Todo: convert exponents and subscripts
|
||||||
-- to use this more concise notation.
|
-- to use this more concise notation.
|
||||||
---@type ExpansionInput[]
|
|
||||||
local abolishAbbreviations = {
|
local abolishAbbreviations = {
|
||||||
-- General phrases
|
-- General phrases
|
||||||
{ "thrf", "therefore" },
|
{ "thrf", "therefore" },
|
||||||
|
@ -153,7 +149,7 @@ local abolishAbbreviations = {
|
||||||
{
|
{
|
||||||
"gt{{e,E,v,V,L},k,a,w,d,md{,e},c{,e}{,l}}{,s,h,x,y}{,a,1,2}",
|
"gt{{e,E,v,V,L},k,a,w,d,md{,e},c{,e}{,l}}{,s,h,x,y}{,a,1,2}",
|
||||||
"{{},\\kappa,\\alpha,\\omega,\\Delta,\\delta{,'},\\chi{,'}{,_l}}({G,S,H,X,Y}{,',_1,_2})",
|
"{{},\\kappa,\\alpha,\\omega,\\Delta,\\delta{,'},\\chi{,'}{,_l}}({G,S,H,X,Y}{,',_1,_2})",
|
||||||
options = no_capitalization,
|
options = A.no_capitalization,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- My own operator syntax:
|
-- My own operator syntax:
|
||||||
|
@ -164,7 +160,7 @@ local abolishAbbreviations = {
|
||||||
{
|
{
|
||||||
"{cr,a,}{eq,neq,leq,geq,lt,gt}",
|
"{cr,a,}{eq,neq,leq,geq,lt,gt}",
|
||||||
"{\\\\\\&,&,}{=,\\neq,\\leq,\\geq,<,>}",
|
"{\\\\\\&,&,}{=,\\neq,\\leq,\\geq,<,>}",
|
||||||
options = no_capitalization,
|
options = A.no_capitalization,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Exponents and subscripts:
|
-- Exponents and subscripts:
|
||||||
|
@ -179,7 +175,7 @@ local abolishAbbreviations = {
|
||||||
{
|
{
|
||||||
"{e,s}{{0,1,2,3,4,5,6,7,8,9,n,i,t,k},t{i,m,p}}",
|
"{e,s}{{0,1,2,3,4,5,6,7,8,9,n,i,t,k},t{i,m,p}}",
|
||||||
"{^,_}{{},{\\{-1\\},-,+}}",
|
"{^,_}{{},{\\{-1\\},-,+}}",
|
||||||
options = no_capitalization,
|
options = A.no_capitalization,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Set symbols
|
-- Set symbols
|
||||||
|
@ -194,7 +190,7 @@ local abolishAbbreviations = {
|
||||||
{
|
{
|
||||||
"{nats,ints,rats,irats,rrea,comp,ppri,ffie}",
|
"{nats,ints,rats,irats,rrea,comp,ppri,ffie}",
|
||||||
"\\mathbb\\{{N,Z,Q,I,R,C,P,F}\\}",
|
"\\mathbb\\{{N,Z,Q,I,R,C,P,F}\\}",
|
||||||
options = no_capitalization,
|
options = A.no_capitalization,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Function calls:
|
-- Function calls:
|
||||||
|
|
31
dotfiles/neovim/lua/my/abbreviations/fp.lua
Normal file
31
dotfiles/neovim/lua/my/abbreviations/fp.lua
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
local A = require("my.abbreviations")
|
||||||
|
local scrap = require("scrap")
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.symols = {
|
||||||
|
{ "mto", ">>=" }, -- [M]onadic [t]o
|
||||||
|
{ "oalt", "<\\|>" }, -- [O]peration [A]lternative
|
||||||
|
{ "omono", "<>" }, -- [O]peration [M]onoid
|
||||||
|
}
|
||||||
|
|
||||||
|
M.types = {
|
||||||
|
{ "tarr", "Array" },
|
||||||
|
{ "tlis", "List" },
|
||||||
|
{ "tmay", "Maybe" },
|
||||||
|
{ "teff", "Effect" },
|
||||||
|
{ "taff", "Aff" },
|
||||||
|
{ "tnea", "NonEmptyArray" },
|
||||||
|
}
|
||||||
|
|
||||||
|
M.functions = {
|
||||||
|
{ "tfold", "toUnfoldable" }, -- [T]o [f]oldable
|
||||||
|
{ "ffold", "fromFoldable" }, -- [F]rom un[f]oldable
|
||||||
|
}
|
||||||
|
|
||||||
|
function M.setup()
|
||||||
|
A.manyGlobalAbbr(scrap.expand_many(M.types, A.no_capitalization))
|
||||||
|
A.manyGlobalAbbr(scrap.expand_many(M.symols, A.no_capitalization))
|
||||||
|
A.manyGlobalAbbr(scrap.expand_many(M.functions, A.no_capitalization))
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
|
@ -6,7 +6,7 @@ M.symols = {
|
||||||
-- Unicode:
|
-- Unicode:
|
||||||
{ "iin", "∈" }, -- [I]ncluded [i][n]
|
{ "iin", "∈" }, -- [I]ncluded [i][n]
|
||||||
{ "mfrl", "∀" }, -- [M]ath [f]o[r]al[l]
|
{ "mfrl", "∀" }, -- [M]ath [f]o[r]al[l]
|
||||||
{ "eps", "ε" }, -- Epsilon
|
{ "eps", "ε" }, -- [E]psilon
|
||||||
|
|
||||||
-- Ascii stuff:
|
-- Ascii stuff:
|
||||||
{ "tto", "->" }, -- [t]o
|
{ "tto", "->" }, -- [t]o
|
||||||
|
@ -16,7 +16,7 @@ M.symols = {
|
||||||
|
|
||||||
{ "leq", "<=" }, -- [l]ess than or [e][q]ual
|
{ "leq", "<=" }, -- [l]ess than or [e][q]ual
|
||||||
{ "geq", ">=" }, -- [g]reater than or [e][q]ual
|
{ "geq", ">=" }, -- [g]reater than or [e][q]ual
|
||||||
{ "eq", "=" }, -- [e][q]ual
|
{ "seq", "=" }, -- [s]ingle [e][q]ual
|
||||||
{ "deq", "==" }, -- [d]ouble [e][q]ual
|
{ "deq", "==" }, -- [d]ouble [e][q]ual
|
||||||
{ "land", "/\\" }, -- [l]ogial [a][n][d]
|
{ "land", "/\\" }, -- [l]ogial [a][n][d]
|
||||||
{ "lor", "\\/" }, -- [l]ogial [o][r]
|
{ "lor", "\\/" }, -- [l]ogial [o][r]
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
|
M.no_capitalization = { capitalized = false }
|
||||||
|
|
||||||
function M.localAbbr(lhs, rhs)
|
function M.localAbbr(lhs, rhs)
|
||||||
-- Create abbreviation
|
-- Create abbreviation
|
||||||
vim.cmd(":iabbrev <buffer> " .. lhs .. " " .. rhs)
|
vim.cmd(":iabbrev <buffer> " .. lhs .. " " .. rhs)
|
||||||
|
|
|
@ -48,18 +48,7 @@ function M.setup()
|
||||||
-- {{{ Easier access to <C-^>
|
-- {{{ Easier access to <C-^>
|
||||||
M.move("<C-^>", "<Leader>a", { desc = "[A]lternate file" })
|
M.move("<C-^>", "<Leader>a", { desc = "[A]lternate file" })
|
||||||
-- }}}
|
-- }}}
|
||||||
-- {{{ Quit current buffer / all buffers
|
-- {{{ Quit all buffers
|
||||||
vim.keymap.set({ "n", "v" }, "<leader>q", function()
|
|
||||||
local buf = vim.api.nvim_win_get_buf(0)
|
|
||||||
|
|
||||||
-- Only save if file is writable
|
|
||||||
if vim.bo[buf].modifiable and not vim.bo[buf].readonly then
|
|
||||||
vim.cmd([[write]])
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.cmd("q")
|
|
||||||
end, { desc = "[Q]uit current buffer" })
|
|
||||||
|
|
||||||
M.nmap("Q", ":wqa<cr>", "Save all files and [q]uit")
|
M.nmap("Q", ":wqa<cr>", "Save all files and [q]uit")
|
||||||
-- }}}
|
-- }}}
|
||||||
-- {{{ Replace word in file
|
-- {{{ Replace word in file
|
||||||
|
@ -73,6 +62,7 @@ function M.setup()
|
||||||
-- {{{Diagnostic keymaps
|
-- {{{Diagnostic keymaps
|
||||||
M.nmap("[d", vim.diagnostic.goto_prev, "Goto previous [d]iagnostic")
|
M.nmap("[d", vim.diagnostic.goto_prev, "Goto previous [d]iagnostic")
|
||||||
M.nmap("]d", vim.diagnostic.goto_next, "Goto next [d]iagnostic")
|
M.nmap("]d", vim.diagnostic.goto_next, "Goto next [d]iagnostic")
|
||||||
|
M.move("J", "qj")
|
||||||
M.nmap("J", vim.diagnostic.open_float, "Open current diagnostic")
|
M.nmap("J", vim.diagnostic.open_float, "Open current diagnostic")
|
||||||
M.nmap("<leader>D", vim.diagnostic.setloclist, "[D]iagnostic loclist")
|
M.nmap("<leader>D", vim.diagnostic.setloclist, "[D]iagnostic loclist")
|
||||||
-- }}}
|
-- }}}
|
||||||
|
@ -83,6 +73,12 @@ function M.setup()
|
||||||
vim.keymap.set({ "n", "v" }, "<f11>", '"+', { desc = "Use global clipboard" }) -- Use global clipboard with *cp*
|
vim.keymap.set({ "n", "v" }, "<f11>", '"+', { desc = "Use global clipboard" }) -- Use global clipboard with *cp*
|
||||||
M.nmap("<f12>", ":silent write<cr>", "Save current file") -- Save using *ji*
|
M.nmap("<f12>", ":silent write<cr>", "Save current file") -- Save using *ji*
|
||||||
-- }}}
|
-- }}}
|
||||||
|
-- {{{ Shift-Enter for not continuing the current comment
|
||||||
|
-- This does not preserve intendation. Not sure what a better solution would look like.
|
||||||
|
vim.keymap.set("i", "<S-CR>", function()
|
||||||
|
vim.paste({ "", "" }, -1)
|
||||||
|
end, { desc = "Insert newline without continuing the current comment" })
|
||||||
|
-- }}}
|
||||||
-- {{{ Allow quiting basic buffers with "q"
|
-- {{{ Allow quiting basic buffers with "q"
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = { "help" },
|
pattern = { "help" },
|
||||||
|
@ -97,12 +93,6 @@ function M.setup()
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
-- }}}
|
-- }}}
|
||||||
-- {{{ Shift-Enter for not continuing the current comment
|
|
||||||
-- This does not preserve intendation. Not sure what a better solution would look like.
|
|
||||||
vim.keymap.set("i", "<S-CR>", function()
|
|
||||||
vim.paste({ "", "" }, -1)
|
|
||||||
end, { desc = "Insert newline without continuing the current comment" })
|
|
||||||
-- }}}
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,18 +14,17 @@ function M.setup()
|
||||||
vim.opt.number = true -- Show line numbers
|
vim.opt.number = true -- Show line numbers
|
||||||
vim.opt.relativenumber = true -- Relative line numbers
|
vim.opt.relativenumber = true -- Relative line numbers
|
||||||
|
|
||||||
-- TODO: only do this for specific filestypes
|
|
||||||
vim.opt.expandtab = true -- Use spaces for the tab char
|
vim.opt.expandtab = true -- Use spaces for the tab char
|
||||||
|
|
||||||
vim.opt.scrolloff = 4 -- Lines of context
|
|
||||||
vim.opt.shiftround = true -- Round indent
|
|
||||||
vim.opt.shiftwidth = 2 -- Size of an indent
|
vim.opt.shiftwidth = 2 -- Size of an indent
|
||||||
|
vim.opt.shiftround = true -- When using < or >, rounds to closest multiple of shiftwidth
|
||||||
|
vim.opt.smartindent = true -- Insert indents automatically
|
||||||
|
|
||||||
|
vim.opt.scrolloff = 4 -- Starts scrolling 4 lines from the edge of the screen
|
||||||
vim.opt.termguicolors = true -- True color support
|
vim.opt.termguicolors = true -- True color support
|
||||||
|
|
||||||
vim.opt.ignorecase = true -- Ignore case
|
vim.opt.ignorecase = true -- Ignore case
|
||||||
vim.opt.smartcase = true -- Do not ignore case with capitals
|
vim.opt.smartcase = true -- Do not ignore case with capitals
|
||||||
|
|
||||||
vim.opt.smartindent = true -- Insert indents automatically
|
|
||||||
|
|
||||||
vim.opt.splitbelow = true -- Put new windows below current
|
vim.opt.splitbelow = true -- Put new windows below current
|
||||||
vim.opt.splitright = true -- Put new windows right of current
|
vim.opt.splitright = true -- Put new windows right of current
|
||||||
|
|
|
@ -6,6 +6,7 @@ local M = {
|
||||||
"mrjones2014/smart-splits.nvim", -- the name says it all
|
"mrjones2014/smart-splits.nvim", -- the name says it all
|
||||||
},
|
},
|
||||||
keys = { "<C-w>", "<leader>v" },
|
keys = { "<C-w>", "<leader>v" },
|
||||||
|
event = "VeryLazy",
|
||||||
}
|
}
|
||||||
|
|
||||||
local venn_hint = [[
|
local venn_hint = [[
|
||||||
|
|
|
@ -22,10 +22,10 @@ function M.config()
|
||||||
end, { desc = desc, bufnr = true })
|
end, { desc = desc, bufnr = true })
|
||||||
end
|
end
|
||||||
|
|
||||||
nmap("C", "make_case", "Make [c]plit")
|
nmap("C", "make_case", "Make [c]ase")
|
||||||
nmap("L", "make_lemma", "Make [l]emma")
|
nmap("L", "make_lemma", "Make [l]emma")
|
||||||
nmap("c", "add_clause", "Add [c]lause")
|
nmap("c", "add_clause", "Add [c]lause")
|
||||||
nmap("s", "expr_search", "Expression [s]earch")
|
nmap("e", "expr_search", "[E]xpression search")
|
||||||
nmap("d", "generate_def", "Generate [d]efinition")
|
nmap("d", "generate_def", "Generate [d]efinition")
|
||||||
nmap("s", "case_split", "Case [s]plit")
|
nmap("s", "case_split", "Case [s]plit")
|
||||||
nmap("h", "refine_hole", "Refine [h]ole")
|
nmap("h", "refine_hole", "Refine [h]ole")
|
||||||
|
|
|
@ -119,14 +119,6 @@ return {
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
-- show context on closing parenthesis
|
|
||||||
-- TODO: move this to treesitter file
|
|
||||||
"haringsrob/nvim_context_vt",
|
|
||||||
event = "BufReadPost",
|
|
||||||
cond = env.vscode.not_active(),
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
-- show progress for lsp stuff
|
-- show progress for lsp stuff
|
||||||
"j-hui/fidget.nvim",
|
"j-hui/fidget.nvim",
|
||||||
|
|
|
@ -53,7 +53,7 @@ function M.on_attach(client, bufnr)
|
||||||
vim.keymap.set("n", from, to, opts(desc))
|
vim.keymap.set("n", from, to, opts(desc))
|
||||||
end
|
end
|
||||||
-- }}}
|
-- }}}
|
||||||
-- {{{ Go to declaration / definition / implementation
|
-- {{{ Go to declaration / references / implementation
|
||||||
nmap("gd", vim.lsp.buf.definition, "[G]o to [d]efinition")
|
nmap("gd", vim.lsp.buf.definition, "[G]o to [d]efinition")
|
||||||
nmap("gi", vim.lsp.buf.implementation, "[G]o to [i]mplementation")
|
nmap("gi", vim.lsp.buf.implementation, "[G]o to [i]mplementation")
|
||||||
nmap("gr", vim.lsp.buf.references, "[G]o to [r]eferences")
|
nmap("gr", vim.lsp.buf.references, "[G]o to [r]eferences")
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
|
local env = require("my.helpers.env")
|
||||||
|
|
||||||
local M = {
|
local M = {
|
||||||
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
event = "BufReadPost",
|
event = "BufReadPost",
|
||||||
|
@ -40,26 +43,6 @@ local M = {
|
||||||
additional_vim_regex_highlighting = false,
|
additional_vim_regex_highlighting = false,
|
||||||
},
|
},
|
||||||
--}}}
|
--}}}
|
||||||
--{{{ Incremental selection
|
|
||||||
incremental_selection = {
|
|
||||||
enable = true,
|
|
||||||
keymaps = {
|
|
||||||
init_selection = "<C-space>",
|
|
||||||
node_incremental = "<C-space>",
|
|
||||||
scope_incremental = "<C-s>",
|
|
||||||
node_decremental = "<C-b>",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
--}}}
|
|
||||||
--{{{ Textsubjects
|
|
||||||
textsubjects = {
|
|
||||||
enable = true,
|
|
||||||
keymaps = {
|
|
||||||
["."] = "textsubjects-smart",
|
|
||||||
[";"] = "textsubjects-container-outer",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
--}}}
|
|
||||||
textobjects = {
|
textobjects = {
|
||||||
--{{{ Select
|
--{{{ Select
|
||||||
select = {
|
select = {
|
||||||
|
@ -100,6 +83,13 @@ local M = {
|
||||||
indent = { enable = true },
|
indent = { enable = true },
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
-- show context on closing parenthesis
|
||||||
|
"haringsrob/nvim_context_vt",
|
||||||
|
event = "BufReadPost",
|
||||||
|
cond = env.vscode.not_active(),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -40,21 +40,31 @@ in
|
||||||
search.default = "Google";
|
search.default = "Google";
|
||||||
|
|
||||||
extensions = with inputs.firefox-addons.packages.${pkgs.system}; [
|
extensions = with inputs.firefox-addons.packages.${pkgs.system}; [
|
||||||
|
buster-captcha-solver
|
||||||
bypass-paywalls-clean
|
bypass-paywalls-clean
|
||||||
clearurls # removes ugly args from urls
|
clearurls # removes ugly args from urls
|
||||||
|
don-t-fuck-with-paste # disallows certain websites from disabling pasting
|
||||||
firenvim # summon a nvim instance inside the browser
|
firenvim # summon a nvim instance inside the browser
|
||||||
gesturefy # mouse gestures
|
gesturefy # mouse gestures
|
||||||
|
i-dont-care-about-cookies
|
||||||
localcdn # caches libraries locally
|
localcdn # caches libraries locally
|
||||||
lovely-forks # displays forks on github
|
lovely-forks # displays forks on github
|
||||||
octolinker # github import to link thingy
|
octolinker # github import to link thingy
|
||||||
octotree # github file tree
|
octotree # github file tree
|
||||||
privacy-badger # blocks some trackers
|
privacy-badger # blocks some trackers
|
||||||
privacy-pass # captcha stuff
|
privacy-pass # captcha stuff
|
||||||
|
refined-github # a bunch of github modifications
|
||||||
return-youtube-dislikes
|
return-youtube-dislikes
|
||||||
ublock-origin # ad blocker
|
steam-database # adds info from steamdb on storepages
|
||||||
vimium-c # vim keybinds
|
|
||||||
sponsorblock # skip youtube sponsors
|
sponsorblock # skip youtube sponsors
|
||||||
|
skip-redirect # attempts to skip to the final reddirect for certain urls
|
||||||
|
terms-of-service-didnt-read
|
||||||
translate-web-pages
|
translate-web-pages
|
||||||
|
ublock-origin
|
||||||
|
unpaywall
|
||||||
|
user-agent-string-switcher
|
||||||
|
vimium-c # vim keybinds
|
||||||
|
youtube-shorts-block
|
||||||
];
|
];
|
||||||
|
|
||||||
# Specify custom search engines
|
# Specify custom search engines
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
gimp # Image editing
|
gimp # Image editing
|
||||||
libreoffice # Free office suite
|
libreoffice # Free office suite
|
||||||
lmms # Music software
|
lmms # Music software
|
||||||
|
kicad # PCB editing
|
||||||
# obs-studio # video recorder
|
# obs-studio # video recorder
|
||||||
|
|
||||||
# Clis
|
# Clis
|
||||||
|
|
Loading…
Reference in a new issue