Skip to content

Commit

Permalink
NeoVim goes brrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr (* 10000…
Browse files Browse the repository at this point in the history
…0^{1000000}^{...})
  • Loading branch information
SingularisArt committed Aug 21, 2023
1 parent 0f2c781 commit 4ac59b9
Show file tree
Hide file tree
Showing 72 changed files with 6,323 additions and 510 deletions.
Binary file modified aspects/dotfiles/files/.local/share/autojump/autojump.txt
Binary file not shown.
Binary file modified aspects/dotfiles/files/.local/share/autojump/autojump.txt.bak
Binary file not shown.
Binary file modified aspects/dotfiles/files/.local/share/newsboat/cache.db
Binary file not shown.
Binary file modified aspects/dotfiles/files/.local/share/zathura/history
Binary file not shown.
68 changes: 67 additions & 1 deletion aspects/nvim/files/.config/nvim/ftplugin/go.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,79 @@ local which_key = require("which-key")
local options = require("config.global").which_key_vars.options

options = vim.tbl_deep_extend("force", {
filetype = "python",
filetype = "lua",
buffer = vim.api.nvim_get_current_buf(),
}, options)

which_key.register({
["L"] = {
name = "Language",
o = { "<CMD>GoPkgOutline<CR>", "Package Outline" },
m = { "<CMD>GoMockGen<CR>", "Generate mocks for current file" },
I = { "<CMD>GoToggleInlay<CR>", "Toggle inlay hints" },
r = { "<CMD>GoGenReturn<CR>", "Create return value for current function" },
f = {
name = "Auto Fill",
s = { "<CMD>GoFillStruct<CR>", "Auto fill struct" },
w = { "<CMD>GoFillSwitch<CR>", "Fill switch" },
e = { "<CMD>GoIfErr<CR>", "Add if err" },
p = { "<CMD>GoFillPlurals<CR>", "change func foo(b int, a int, r int) -> func foo(b, a, r int)" },
},
i = {
name = "Install",
i = { "<CMD>GoInstallBinaries<CR>", "Install all tools, skip the ones installed" },
u = { "<CMD>GoUpdateBinaries<CR>", "Update all tools to the latest version" },
},
b = {
name = "Build",
m = { "<CMD>GoMake<CR>", "Make" },
g = { "<CMD>GoBuild<CR>", "Build" },
r = { "<CMD>GoGenerate<CR>", "Generate" },
s = { "<CMD>GoStop<CR>", "Stop job GoRun started" },
},
t = {
name = "Test",
t = { "<CMD>GoTest<CR>", "Test" },
w = { "<CMD>GoTestSum -w<CR>", "Test in watch mode" },
v = { "<CMD>GoTest -v<CR>", "Test -v current file path" },
c = { "<CMD>GoTest -c<CR>", "Test -c current file path" },
n = { "<CMD>GoTest -n<CR>", "Test nearest" },
f = { "<CMD>GoTest -f<CR>", "Test current file" },
p = { "<CMD>GoTest -p<CR>", "Test current package" },
v = { "<CMD>GoVet<CR>", "Vet" },
C = { "<CMD>GoCoverage<CR>", "Test cover profile" },
P = { "<CMD>GoCoverage -p<CR>", "Test package for current buffer" },
},
T = {
name = "Tags",
a = { "<CMD>GoAddTag<CR>", "Add tag" },
r = { "<CMD>GoRmTag<CR>", "Remove tag" },
c = { "<CMD>GoClearTag<CR>", "Clear tag" },
},
f = {
name = "Format",
f = { "<CMD>GoFmt<CR>", "Format" },
i = { "<CMD>GoImport<CR>", "Import" },
},
s = {
name = "Switch between go and test file",
a = { "<CMD>GoAlt!<CR>", "Alternate file" },
s = { "<CMD>GoAltS!<CR>", "Alternate file (horizontal split)" },
v = { "<CMD>GoAltv!<CR>", "Alternate file (vertical split)" },
},
m = {
name = "Mod",
i = { "<CMD>GoModInit<CR>", "Run go mod init" },
t = { "<CMD>GoModInit<CR>", "Run go mod tidy" },
v = { "<CMD>GoModInit<CR>", "Run go mod vendor" },
},
u = {
name = "Unit Tests",
f = { "<CMD><CR>", "Run tests for current function" },
F = { "<CMD><CR>", "Run tests for current file" },
s = { "<CMD><CR>", "Select test function" },
p = { "<CMD><CR>", "Run tests for package" },
},
},
}, options)

Expand Down
4 changes: 2 additions & 2 deletions aspects/nvim/files/.config/nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
vim.loader.enable()

-- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy")
vim.cmd("set rtp+=~/Documents/school-notes/current-course")
require("config")
-- vim.cmd("set rtp+=~/Documents/school-notes/current-course")
19 changes: 19 additions & 0 deletions aspects/nvim/files/.config/nvim/lua/config/autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,22 @@ vim.api.nvim_create_autocmd("FileType", {
vim.o.foldenable = false
end,
})

vim.api.nvim_create_autocmd({ "BufWritePre" }, {
group = augroup("CommitMSG"),
pattern = { "/tmp/*", "COMMIT_EDITMSG", "MERGE_MSG", "*.tmp", "*.bak" },
callback = function()
vim.opt_local.undofile = false
end,
})

vim.api.nvim_create_autocmd({ "BufWritePost", "FileWritePost" }, {
group = augroup("Vim"),
pattern = "*.vim",
command = [[ if &l:autoread > 0 | source <afile> | echo "source " . bufname("%") | endif]],
})

vim.api.nvim_create_autocmd("BufReadPre", {
group = augroup("Syntax"),
command = [[ if getfsize(expand('%')) > 1000000 | ownsyntax off | endif ]],
})
Loading

0 comments on commit 4ac59b9

Please sign in to comment.