chore: minor changes

This commit is contained in:
Kristofers Solo 2024-03-09 14:57:04 +02:00
parent 61b013792e
commit c9cf36710c
22 changed files with 258 additions and 31 deletions

3
after/ftplugin/c.lua Normal file
View File

@ -0,0 +1,3 @@
vim.opt_local.tabstop = 4
vim.opt_local.shiftwidth = 4
vim.opt_local.softtabstop = 4

View File

@ -0,0 +1,3 @@
vim.opt_local.tabstop = 2
vim.opt_local.shiftwidth = 2
vim.opt_local.softtabstop = 2

61
after/plugin/snips/c.lua Normal file
View File

@ -0,0 +1,61 @@
if not pcall(require, "luasnip") then
return
end
local ls = require("luasnip")
local s = ls.snippet
local i = ls.insert_node
local f = ls.function_node
local fmt = require("luasnip.extras.fmt").fmt
local shared = require("solo.snips")
local same = shared.same
local year = shared.year
local date = shared.date
ls.add_snippets("c", {
s(
"auth",
fmt(
[[
// Copyright {}
// Author - Kristiāns Francis Cagulis, kc22015
// {}
// Created: {}
]],
{
year(),
i(1),
date(),
}
)
),
s(
"fn",
fmt(
[[
// {};
// Funkcija {}({}) -
// {}
{} {{
}}
]],
{
same(1),
f(function(function_name)
if not function_name[1][1] then
function_name[1][1] = ""
end
local words = {}
for word in function_name[1][1]:gmatch("%w+") do
table.insert(words, word)
end
return words[2] or ""
end, { 1 }),
i(2),
i(0),
i(1),
}
)
),
})

View File

@ -1,5 +1,6 @@
return {
"LunarVim/bigfile.nvim",
event = "BufReadPre",
opts = {
filesize = 1, -- size of the file in MiB, the plugin round file sizes to the closest MiB
pattern = { "*" }, -- autocmd pattern or function see <### Overriding the detection of big files>

View File

@ -4,7 +4,7 @@ return {
dependencies = {
"hrsh7th/cmp-buffer", -- buffer completions
"hrsh7th/cmp-cmdline",
"FelipeLema/cmp-async-path", -- path completionsplu
"FelipeLema/cmp-async-path", -- path completions
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-nvim-lsp",
{ "Saecki/crates.nvim", event = { "BufRead Cargo.toml" } },
@ -13,7 +13,7 @@ return {
dependencies = { "nvim-lua/plenary.nvim" },
event = { "BufRead pyproject.toml", "BufRead requirements.txt", "BufRead requirements_dev.txt" },
},
{ "kristijanhusak/vim-dadbod-completion", dependencies = { "tpope/vim-dadbod" } },
-- { "kristijanhusak/vim-dadbod-completion", dependencies = { "tpope/vim-dadbod" } },
"SergioRibera/cmp-dotenv",
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
@ -71,7 +71,7 @@ return {
}),
-- Accept currently selected item. If none selected, `select` first item.
-- Set `select` to `false` to only confirm explicitly selected items.
["<cr>"] = cmp.mapping.confirm({ select = true }),
["<enter>"] = cmp.mapping.confirm({ select = true }),
},
sources = {
{ name = "nvim_lua" },
@ -82,7 +82,7 @@ return {
{ name = "buffer", keyword_length = 4 },
{ name = "neorg" },
{ name = "pypi" },
{ name = "dadbod" },
-- { name = "dadbod" },
{ name = "env" },
{ name = "calc" },
{ name = "emoji" },
@ -116,7 +116,7 @@ return {
neorg = "[neorg]",
crates = "[crates]",
pypi = "[pypi]",
dadbod = "[dadbod]",
-- dadbod = "[dadbod]",
env = "[env]",
buffer = "[buf]",
})[entry.source.name]
@ -138,11 +138,11 @@ return {
},
})
cmp.setup.cmdline("/", {
--[[ cmp.setup.cmdline("/", {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "buffer" },
},
})
}) ]]
end,
}

View File

@ -1,6 +1,8 @@
return {
"Exafunction/codeium.nvim",
enabled = false,
dependencies = { "nvim-lua/plenary.nvim" },
event = "BufEnter",
dependencies = {
"nvim-lua/plenary.nvim",
},
opts = {},
}

View File

@ -1,7 +1,7 @@
return {
"NvChad/nvim-colorizer.lua",
opts = {
filetypes = { "html", "css", "javascript", "lua", "yaml", "conf", "toml", "scss", "python" },
filetypes = { "html", "css", "javascript", "lua", "yaml", "conf", "toml", "scss", "python", "typst" },
user_default_options = {
RGB = true, -- #RGB hex codes
RRGGBB = true, -- #RRGGBB hex codes

View File

@ -24,5 +24,6 @@ return {
{ "EdenEast/nightfox.nvim" },
{ "navarasu/onedark.nvim" },
{ "savq/melange-nvim" },
{ "ellisonleao/gruvbox.nvim" },
{ "bluz71/vim-nightfly-colors", name = "nightfly" },
}

View File

@ -1,6 +1,7 @@
return {
"zbirenbaum/copilot.lua",
event = "InsertEnter",
enabled = false,
opts = {
panel = {
enabled = false,

View File

@ -1,5 +1,14 @@
return {
"kristijanhusak/vim-dadbod-ui",
dependencies = {
{ "tpope/vim-dotenv" },
{ "tpope/vim-dadbod" },
{ "kristijanhusak/vim-dadbod-ui" },
{ "kristijanhusak/vim-dadbod-completion" },
{ "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql" } },
},
cmd = {
"DBUI",
"DBUIToggle",
"DBUIAddConnection",
"DBUIFindBuffer",
},
}

4
lua/plugins/hlargs.lua Normal file
View File

@ -0,0 +1,4 @@
return {
"m-demare/hlargs.nvim",
opts = {},
}

View File

@ -41,7 +41,7 @@ return {
"i",
"<C-k>",
vim.lsp.buf.signature_help,
{ buffer = event.buf, desc = "Signature Documentation" }
{ buffer = event.buf, desc = "LSP: Signature Documentation" }
)
nmap("<leader>wa", vim.lsp.buf.add_workspace_folder, "[W]orkspace [A]dd Folder")
nmap("<leader>wr", vim.lsp.buf.remove_workspace_folder, "[W]orkspace [R]emove Folder")
@ -58,7 +58,7 @@ return {
local trouble = require("trouble")
trouble.open("workspace_diagnostics")
trouble.next({ skip_groups = true, jump = true })
end, "Trouble Next")
end, "LSP: Trouble Next")
nmap("[d", function()
local trouble = require("trouble")
trouble.open("workspace_diagnostics")
@ -68,7 +68,7 @@ return {
{ "n", "v" },
"<leader>la",
vim.lsp.buf.code_action,
{ buffer = event.buf, desc = "Code [A]ction" }
{ buffer = event.buf, desc = "LSP: Code [A]ction" }
)
nmap("gr", function()
require("trouble").toggle("lsp_references")
@ -131,7 +131,6 @@ return {
"jsonls",
"lua_ls",
"tailwindcss",
"taplo",
"texlab",
"tsserver",
},
@ -160,6 +159,12 @@ return {
lua_ls = function()
require("plugins.lsp.lua").setup(lsp, lsp_capabilities)
end,
htmx = function()
local opts = {
filetypes = { "html", "htmldjango" },
}
require("lspconfig").htmx.setup(opts)
end,
},
})
end,

View File

@ -2,6 +2,7 @@ return {
"nvim-neorg/neorg",
build = ":Neorg sync-parsers",
dependencies = { "nvim-lua/plenary.nvim" },
cmd = { "Neorg" },
ft = "norg",
opts = {
load = {

View File

@ -17,8 +17,6 @@ return {
-- Here you can add tools not supported by mason.nvim
-- make sure the source name is supported by null-ls
-- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md
formatting.ruff.with({ extra_args = { "format" } }),
diagnostics.luacheck.with({ extra_args = { "--globals", "vim" } }),
formatting.cbfmt.with({ extra_filetypes = { "vimwiki" } }),
formatting.prettier.with({
extra_filetypes = { "toml" },
@ -33,27 +31,44 @@ return {
"strict",
},
}),
-- formatting.shellharden.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }),
-- formatting.shfmt.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }),
-- formatting.sqlfluff.with({ extra_args = { "--dialect", "postgres" } }),
formatting.sql_formatter.with({
extra_args = {
"-c",
[[
{
"language": "postgresql",
"dialect": "postgresql",
"tabWidth": 2,
"useTabs": false,
"keywordCase": "upper",
"dataTypeCase": "upper",
"functionCase": "upper",
"identifierCase": "upper",
"indentStyle": "standard",
"logicalOperatorNewline": "before",
"expressionWidth": "80",
"linesBetweenQueries": 2,
"denseOperators": false,
"newlineBeforeSemicolon": false
}
]],
},
}),
formatting.rustywind.with({ extra_filetypes = { "htmldjango" } }),
},
})
require("mason-null-ls").setup({
ensure_installed = {
"cbfmt",
"clang_format",
"cmake_format",
"cmake_lint",
"cpplint",
"djlint",
"google_java_format",
"luacheck",
"selene",
"mypy",
"stylua",
"yamlfmt",
"rustywind",
"ruff",
"letexindent",
},
automatic_installation = true,
handlers = {

View File

@ -1 +1,26 @@
return { "andweeb/presence.nvim" }
return {
"andweeb/presence.nvim",
--[[ opts = {
-- General options
auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`)
neovim_image_text = "The One True Text Editor", -- Text displayed when hovered over the Neovim image
main_image = "neovim", -- Main image display (either "neovim" or "file")
-- client_id = "", -- Use your own Discord application client id (not recommended)
log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error")
debounce_timeout = 10, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(<filename>, true)`)
enable_line_number = false, -- Displays the current line number instead of the current project
blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "<label>", url = "<url>" }, ...}`, or a function(buffer: string, repo_url: string|nil): table)
file_assets = {}, -- Custom file asset definitions keyed by file names and extensions (see default config at `lua/presence/file_assets.lua` for reference)
show_time = true, -- Show the timer
-- Rich Presence text options
editing_text = "Editing %s", -- Format string rendered when an editable file is loaded in the buffer (either string or function(filename: string): string)
file_explorer_text = "Browsing %s", -- Format string rendered when browsing a file explorer (either string or function(file_explorer_name: string): string)
git_commit_text = "Committing changes", -- Format string rendered when committing changes in git (either string or function(filename: string): string)
plugin_manager_text = "Managing plugins", -- Format string rendered when managing plugins (either string or function(plugin_manager_name: string): string)
reading_text = "Reading %s", -- Format string rendered when a read-only or unmodifiable file is loaded in the buffer (either string or function(filename: string): string)
workspace_text = "Working on %s", -- Format string rendered when in a git repository (either string or function(project_name: string|nil, filename: string): string)
line_number_text = "Line %s out of %s", -- Format string rendered when `enable_line_number` is set to true (either string or function(line_number: number, line_count: number): string)
}, ]]
}

60
lua/plugins/silicon.lua Normal file
View File

@ -0,0 +1,60 @@
return {
"michaelrommel/nvim-silicon",
lazy = true,
cmd = "Silicon",
opts = {
-- the font settings with size and fallback font
font = "JetBrainsMono NF=34;Noto Emoji=34",
-- the theme to use, depends on themes available to silicon
theme = "Dracula",
-- the background color outside the rendered os window
background = "#1a1b26",
-- a path to a background image
background_image = nil,
-- the paddings to either side
pad_horiz = 100,
pad_vert = 80,
-- whether to have the os window rendered with rounded corners
no_round_corner = false,
-- whether to put the close, minimize, maximise traffic light controls on the border
no_window_controls = false,
-- whether to turn off the line numbers
no_line_number = false,
-- with which number the line numbering shall start, the default is 1, but here a
-- function is used to return the actual source code line number
line_offset = function(args)
return args.line1
end,
-- the distance between lines of code
line_pad = 0,
-- the rendering of tab characters as so many space characters
tab_width = 4,
-- with which language the syntax highlighting shall be done, should be a function
-- that returns either a language name or an extension like ".js"
language = function()
return vim.bo.filetype
end,
-- if the shadow below the os window should have be blurred
shadow_blur_radius = 16,
-- the offset of the shadow in x and y directions
shadow_offset_x = 8,
shadow_offset_y = 8,
-- the color of the shadow
shadow_color = "#100808",
-- whether to strip of superfluous leading whitespace
gobble = true,
-- a string or function that defines the path to the output image
output = function()
return "~/Pictures/screenshots/code/" .. os.date("!%Y_%m_%d-%H_%M_%S") .. ".png"
end,
-- whether to put the image onto the clipboard, may produce an error if run on WSL2
to_clipboard = false,
-- the silicon command, put an absolute location here, if the command is not in your PATH
command = "silicon",
-- a string or function returning a string that defines the title showing in the image
-- only works in silicon versions greater than v0.5.1
window_title = function()
return vim.fn.fnamemodify(vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()), ":t")
end,
},
}

View File

@ -1 +1,4 @@
return { "ThePrimeagen/vim-be-good", lazy = true }
return {
"ThePrimeagen/vim-be-good",
cmd = { "VimBeGood" },
}

View File

@ -37,11 +37,11 @@ vim.api.nvim_create_autocmd({ "InsertEnter" }, {
})
-- Autocommand that sources neovim files on save
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
--[[ vim.api.nvim_create_autocmd({ "BufWritePost" }, {
group = vim.api.nvim_create_augroup("AutoReloadConfig", { clear = true }),
pattern = { "**/nvim/**/*.lua", "**/SoloVim/**/*.lua" },
callback = function()
local file_path = vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf())
vim.cmd.source(file_path)
end,
})
}) ]]

23
neovim.yml Normal file
View File

@ -0,0 +1,23 @@
base: lua51
globals:
vim:
any: true
assert:
args:
- type: bool
- type: string
required: false
after_each:
args:
- type: function
before_each:
args:
- type: function
describe:
args:
- type: string
- type: function
it:
args:
- type: string
- type: function

7
selene.toml Normal file
View File

@ -0,0 +1,7 @@
std = "neovim"
[rules]
global_usage = "allow"
multiple_statements = "allow"
incorrect_standard_library_use = "allow"
mixed_table = "allow"

View File

@ -128,3 +128,6 @@ Nosakot
galvenos
stratēģiskā
Turklāt
grafu
grafos
spēj

Binary file not shown.