improvements, installed ollama gen

This commit is contained in:
RingOfStorms (Joshua Bell) 2023-12-06 16:09:17 -06:00
parent f2f93acdb8
commit 6b2b0c377a
11 changed files with 151 additions and 161 deletions

View file

@ -1 +1 @@
{"language":"en","version":"0.2","flagWords":[],"words":["nvim","builtins","stylua","rustfmt","pendo","tanstack","ripgrep","Typeahead","overscan","autorun","mediatype","BIOINF","Transitioner","pkce","ilike","arrayify","arrayified","komodo","wezterm","gcloud","pbpaste","Hasher","semvers","upserted","dtos","Yeatts","Mahon","Beaubier","Taussing","chakra","langchain","openai","getattr","llms","docstore","kwargs","svgr","healthcheck","venv","virtualenv","ringofstorms","nestjs","oneshot","templating","tiktoken","pydantic","NCCN","clsx","reactflow","Convo","DSAB","pgvector","postprocess","stylelua","sqlx","genemichaels","williamboman","substr","findfile","Hammerspoon","eventtap","OSTYPE","sccache","binstall","elif","autofocus","colours","Resizer","esac","pannable","zoomable","elkjs","Arrayible","Falsey","xyflow","leftnav","topnav","nodrag","nowheel","janky","draghandle","Sandboxed","Dismissable","dashdraw","chrono","serde","rustls","schemars","webserver","concats","deepmerge","Customizer","reqwest","brotli","peekable","PDEPO","dotenv","taskserver","walkdir","uuidgen","tolower","nzzzv","tabprevious","tabnext","vsplit","tabclose","tabnew","Neotree","noequalalways","equalalways","bufdo","winnr","keymap","mapleader","maplocalleader","keymaps","setloclist","itertools"]} {"words":["nvim","builtins","stylua","rustfmt","pendo","tanstack","ripgrep","Typeahead","overscan","autorun","mediatype","BIOINF","Transitioner","pkce","ilike","arrayify","arrayified","komodo","wezterm","gcloud","pbpaste","Hasher","semvers","upserted","dtos","Yeatts","Mahon","Beaubier","Taussing","chakra","langchain","openai","getattr","llms","docstore","kwargs","svgr","healthcheck","venv","virtualenv","ringofstorms","nestjs","oneshot","templating","tiktoken","pydantic","NCCN","clsx","reactflow","Convo","DSAB","pgvector","postprocess","stylelua","sqlx","genemichaels","williamboman","substr","findfile","Hammerspoon","eventtap","OSTYPE","sccache","binstall","elif","autofocus","colours","Resizer","esac","pannable","zoomable","elkjs","Arrayible","Falsey","xyflow","leftnav","topnav","nodrag","nowheel","janky","draghandle","Sandboxed","Dismissable","dashdraw","chrono","serde","rustls","schemars","webserver","concats","deepmerge","Customizer","reqwest","brotli","peekable","PDEPO","dotenv","taskserver","walkdir","uuidgen","tolower","nzzzv","tabprevious","tabnext","vsplit","tabclose","tabnew","Neotree","noequalalways","equalalways","bufdo","winnr","keymap","mapleader","maplocalleader","keymaps","setloclist","itertools","ollama"],"version":"0.2","language":"en","flagWords":[]}

View file

@ -11,6 +11,7 @@
"copilot.lua": { "branch": "master", "commit": "3665ed0f3ef3ad68673df7195789d134d0d1fdb0" }, "copilot.lua": { "branch": "master", "commit": "3665ed0f3ef3ad68673df7195789d134d0d1fdb0" },
"crates.nvim": { "branch": "main", "commit": "1dffccc0a95f656ebe00cacb4de282473430c5a1" }, "crates.nvim": { "branch": "main", "commit": "1dffccc0a95f656ebe00cacb4de282473430c5a1" },
"diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" },
"gen.nvim": { "branch": "main", "commit": "aa951166745dd3cb5a7bf8297ce2bd20d3bb4e00" },
"gitsigns.nvim": { "branch": "main", "commit": "6ef8c54fb526bf3a0bc4efb0b2fe8e6d9a7daed2" }, "gitsigns.nvim": { "branch": "main", "commit": "6ef8c54fb526bf3a0bc4efb0b2fe8e6d9a7daed2" },
"glow.nvim": { "branch": "advanced_window", "commit": "f1157d4cb7e46e830c72004e7e1adb81a1f9b04c" }, "glow.nvim": { "branch": "advanced_window", "commit": "f1157d4cb7e46e830c72004e7e1adb81a1f9b04c" },
"indent-blankline.nvim": { "branch": "master", "commit": "29be0919b91fb59eca9e90690d76014233392bef" }, "indent-blankline.nvim": { "branch": "master", "commit": "29be0919b91fb59eca9e90690d76014233392bef" },

View file

@ -184,7 +184,7 @@ return {
build = ":MasonUpdate", build = ":MasonUpdate",
opts = {}, opts = {},
}, },
{ "folke/neodev.nvim", opts = {} }, -- lua stuff { "folke/neodev.nvim", opts = {} }, -- lua stuff
{ {
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
}, },
@ -264,6 +264,7 @@ return {
["<esc>"] = cmp.mapping(function(fallback) ["<esc>"] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.abort() cmp.abort()
fallback()
else else
fallback() fallback()
end end
@ -286,11 +287,11 @@ return {
-- TODO I am getting lag sometimes I think this may be the cause, limiting to 100 for a while to see what happens -- TODO I am getting lag sometimes I think this may be the cause, limiting to 100 for a while to see what happens
{ name = "nvim_lsp", priority = 8, max_item_count = 100 }, { name = "nvim_lsp", priority = 8, max_item_count = 100 },
-- This source integrates with LuaSnip, a snippet engine for Neovim. It suggests snippets that you can insert into your code -- This source integrates with LuaSnip, a snippet engine for Neovim. It suggests snippets that you can insert into your code
{ name = "luasnip", priority = 7 }, { name = "luasnip", priority = 7 },
-- This source provides file path completions, helping you to complete file paths in your code -- This source provides file path completions, helping you to complete file paths in your code
{ name = "path", priority = 7 }, { name = "path", priority = 7 },
-- This source provides completion items from the current buffer, meaning it suggests words that have already been typed in the same file. -- This source provides completion items from the current buffer, meaning it suggests words that have already been typed in the same file.
{ name = "buffer", priority = 6 }, { name = "buffer", priority = 6 },
-- Rust crates.io integration -- Rust crates.io integration
{ name = "crates" }, { name = "crates" },
}, },

View file

@ -1,24 +1,10 @@
local function prereqs() local U = require("util")
local output_cspell = vim.fn.system({ local cspell = U.cmd_executable("cspell")
"which",
"cspell",
})
if output_cspell == nil or output_cspell == "" or output_cspell == "cspell not found" then
print("Installing cspell globally with npm")
vim.fn.system({
"npm",
"install",
"-g",
"cspell",
})
end
end
return { return {
{ {
"jose-elias-alvarez/null-ls.nvim", "jose-elias-alvarez/null-ls.nvim",
dependencies = { "williamboman/mason.nvim" }, dependencies = { "williamboman/mason.nvim" },
build = prereqs,
opts = function(_, config) opts = function(_, config)
-- config variable is the default definitions table for the setup function call -- config variable is the default definitions table for the setup function call
local null_ls = require("null-ls") local null_ls = require("null-ls")
@ -74,30 +60,41 @@ return {
null_ls.builtins.formatting.prettier, -- typescript/javascript null_ls.builtins.formatting.prettier, -- typescript/javascript
null_ls.builtins.formatting.stylua.with({ null_ls.builtins.formatting.stylua.with({
extra_args = { "--indent-type", "spaces", "--indent-width", "2" }, extra_args = { "--indent-type", "spaces", "--indent-width", "2" },
}), -- lua }), -- lua
--null_ls.builtins.formatting.rustfmt, -- rust --null_ls.builtins.formatting.rustfmt, -- rust
rust_formatter_genemichaels, -- order matters, run genemichaels first then rustfmt rust_formatter_genemichaels, -- order matters, run genemichaels first then rustfmt
rust_formatter_rustfmt, rust_formatter_rustfmt,
-- rust_formatter_sqlx, -- see tools/sqlx-format.lua -- rust_formatter_sqlx, -- see tools/sqlx-format.lua
null_ls.builtins.formatting.black, -- python null_ls.builtins.formatting.black, -- python
-- null_ls.builtins.code_actions.proselint, -- TODO looks interesting -- null_ls.builtins.code_actions.proselint, -- TODO looks interesting
null_ls.builtins.code_actions.cspell.with({
config = {
find_json = function()
return vim.fn.findfile("cspell.json", vim.fn.environ().HOME .. "/.config/nvim/;")
end,
},
}),
null_ls.builtins.diagnostics.cspell.with({
extra_args = { "--config", "~/.config/nvim/cspell.json" },
diagnostics_postprocess = function(diagnostic)
-- vim.notify(vim.inspect(diagnostic))
diagnostic.message = diagnostic.user_data.misspelled
diagnostic.severity = vim.diagnostic.severity.HINT
end,
}),
} }
if cspell then
table.insert(
config.sources,
null_ls.builtins.code_actions.cspell.with({
config = {
find_json = function()
return vim.fn.findfile("cspell.json", vim.fn.environ().HOME .. "/.config/nvim/;")
end,
},
})
)
table.insert(
config.sources,
null_ls.builtins.diagnostics.cspell.with({
extra_args = { "--config", "~/.config/nvim/cspell.json" },
diagnostics_postprocess = function(diagnostic)
-- vim.notify(vim.inspect(diagnostic))
diagnostic.message = diagnostic.user_data.misspelled
diagnostic.severity = vim.diagnostic.severity.HINT
end,
})
)
else
vim.notify("cspell is missing, spelling suggestions will not work", 2)
end
config.update_in_insert = true config.update_in_insert = true
config.debug = true config.debug = true

View file

@ -1,17 +1,4 @@
local function prereqs() local U = require("util")
local output = vim.fn.system({
"which",
"rg",
})
if output == nil or output == "" or string.find(output, "not installed for the toolchain") then
print("Installing ripgrep globally with rtx")
vim.fn.system({
"rtx",
"global",
"ripgrep@latest",
})
end
end
return { return {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
@ -21,7 +8,13 @@ return {
{ "nvim-telescope/telescope-fzf-native.nvim", enabled = vim.fn.executable("make") == 1, build = "make" }, { "nvim-telescope/telescope-fzf-native.nvim", enabled = vim.fn.executable("make") == 1, build = "make" },
{ "nvim-telescope/telescope-ui-select.nvim" }, { "nvim-telescope/telescope-ui-select.nvim" },
}, },
build = prereqs, init = function()
U.cmd_executable("rg", {
[false] = function()
vim.notify("rg not installed, live grep will not function.", 2)
end,
})
end,
cmd = "Telescope", cmd = "Telescope",
keys = { keys = {
{ "<leader>f", "<Nop>", desc = "Find ..." }, { "<leader>f", "<Nop>", desc = "Find ..." },
@ -53,11 +46,15 @@ return {
{ {
"<leader>fw", "<leader>fw",
function() function()
if vim.fn.executable("rg") == 0 then U.cmd_executable("rg", {
vim.notify("rg not installed, live grep will not function.", 3) function()
end require("telescope.builtin").live_grep({
require("telescope.builtin").live_grep({ hidden = true,
hidden = true, })
end,
function()
vim.notify("rg not installed, live grep will not function.", 3)
end,
}) })
end, end,
desc = "Find Words", desc = "Find Words",

View file

@ -1,12 +1,3 @@
local auto = true
local output = vim.fn.system({
"which",
"tree-sitter",
})
if output == nil or output == "" then
auto = false
end
return { return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
@ -67,7 +58,6 @@ return {
"vue", "vue",
"yaml", "yaml",
}, },
-- auto_install = auto,
highlight = { highlight = {
enable = true, enable = true,
use_languagetree = true, use_languagetree = true,

View file

@ -26,6 +26,7 @@ return {
["<leader>Q"] = { name = "+Q Quit and remove session" }, ["<leader>Q"] = { name = "+Q Quit and remove session" },
["<leader>s"] = { name = "Scratch Files" }, ["<leader>s"] = { name = "Scratch Files" },
["<leader>t"] = { name = "Tabs" }, ["<leader>t"] = { name = "Tabs" },
["<leader>x"] = { name = "Generative AI, Ollama" },
}) })
end, end,
} }

View file

@ -1,4 +0,0 @@
return {
"m4xshen/autoclose.nvim",
opts = {},
}

View file

@ -1,9 +0,0 @@
return {
{
"simrat39/rust-tools.nvim",
event = "BufEnter *.rs",
dependencies = { "mason-lspconfig.nvim", "lvimuser/lsp-inlayhints.nvim" },
opts = {},
},
{ "Saecki/crates.nvim", tag = "v0.3.0", dependencies = { "nvim-lua/plenary.nvim" }, opts = {} },
}

View file

@ -6,72 +6,81 @@ local scratch = function(extension)
vim.cmd("execute 'edit " .. filepath .. "'") vim.cmd("execute 'edit " .. filepath .. "'")
end end
require("util").keymaps_old({ local U = require("util")
n = {
["<leader>fsw"] = { U.keymaps({
function() {
require("telescope.builtin").live_grep({ "<leader>fsw",
search_dirs = { "~/dev/scratches/" }, function()
}) require("telescope.builtin").live_grep({
end, search_dirs = { "~/dev/scratches/" },
desc = "Find Words in Scratches", })
}, end,
["<leader>fsf"] = { desc = "Find Words in Scratches",
function() },
require("telescope.builtin").find_files({ {
search_dirs = { "~/dev/scratches/" }, "<leader>fsf",
}) function()
end, require("telescope.builtin").find_files({
desc = "Find Scratches", search_dirs = { "~/dev/scratches/" },
}, })
["<leader>s"] = { "<Nop>", desc = "Scratch File" }, end,
["<leader>ss"] = { desc = "Find Scratches",
function() },
scratch(".txt") { "<leader>s", "<Nop>", desc = "Scratch File" },
end, ["<leader>ss"] = {
desc = "New [t]e[xt] scratch file", function()
}, scratch(".txt")
["<leader>sn"] = { end,
function() desc = "New text scratch file",
scratch(".json") },
end, {
desc = "New json scratch file", "<leader>sn",
}, function()
["<leader>sm"] = { scratch(".json")
function() end,
scratch(".md") desc = "New json scratch file",
end, },
desc = "New [m]ark[d]own scratch file", {
}, "<leader>sm",
["<leader>sq"] = { function()
function() scratch(".md")
scratch(".sql") end,
end, desc = "New markdown scratch file",
desc = "New sql scratch file", },
}, {
["<leader>st"] = { "<leader>sq",
function() function()
scratch(".ts") scratch(".sql")
end, end,
desc = "New [t]ype[s]cript scratch file", desc = "New sql scratch file",
}, },
["<leader>sb"] = { {
function() "<leader>st",
scratch(".sh") function()
end, scratch(".ts")
desc = "New [sh]ell scratch file", end,
}, desc = "New typescript scratch file",
["<leader>sj"] = { },
function() {
scratch(".js") "<leader>sb",
end, function()
desc = "New [j]ava[s]cript scratch file", scratch(".sh")
}, end,
["<leader>sr"] = { desc = "New shell scratch file",
function() },
scratch(".rs") {
end, "<leader>sj",
desc = "New [r]u[s]t scratch file", function()
}, scratch(".js")
end,
desc = "New javascript scratch file",
},
{
"<leader>sr",
function()
scratch(".rs")
end,
desc = "New rust scratch file",
}, },
}) })

View file

@ -1,23 +1,30 @@
local M = {} local M = {}
function M.keymaps_old(mappings) function M.cmd_executable(cmd, callback)
for mode, maps in pairs(mappings) do local executable = vim.fn.executable(cmd) == 1
for keymap, options in pairs(maps) do -- Check if a callback is provided and it is a function
if options then if executable and callback and type(callback) == "function" then
local cmd = options callback()
local keymap_opts = {} end
if type(options) == "table" then
cmd = options[1]
keymap_opts = vim.tbl_deep_extend("force", keymap_opts, options)
keymap_opts[1] = nil
end
if mode and keymap and cmd and keymap_opts then -- Check if a callback is provided and it is a table
vim.keymap.set(mode, keymap, cmd, keymap_opts) if type(callback) == "table" then
end if executable and (callback[1] or callback[true]) then
-- Call the function associated with key 1 or true if the command is executable
local func = callback[1] or callback[true]
if type(func) == "function" then
func()
end
elseif not executable and (callback[2] or callback[false]) then
-- Call the function associated with key 2 or false if the command is not executable
local func = callback[2] or callback[false]
if type(func) == "function" then
func()
end end
end end
end end
return executable
end end
-- [1]: (string) lhs (required) -- [1]: (string) lhs (required)