Compare commits

...

5 Commits

Author SHA1 Message Date
dc788b1c00 fix mason 2023-02-04 17:25:37 +01:00
4027ba20a2 disable stuff 2023-02-04 16:46:27 +01:00
057b357f05 update nvim 2023-02-03 16:08:09 +01:00
c5d8b5ef2b without dataviewjs 2023-01-20 10:54:38 +01:00
7a65e3fb59 with v3 2023-01-20 10:54:22 +01:00
38 changed files with 360 additions and 224 deletions

View File

@@ -2,7 +2,7 @@ return {
source_priority = { source_priority = {
nvim_lsp = 1000, nvim_lsp = 1000,
luasnip = 750, luasnip = 750,
buffer = 500, path = 500,
path = 250, buffer = 250,
}, },
} }

View File

@@ -1,4 +0,0 @@
return {
fg = "#abb2bf",
bg = "#1e222a",
}

View File

@@ -1,13 +0,0 @@
return function(hl) -- or a function that returns a new table of colors to set
local C = require "default_theme.colors"
hl.Normal = { fg = C.fg, bg = C.bg }
-- New approach instead of diagnostic_style
hl.DiagnosticError.italic = true
hl.DiagnosticHint.italic = true
hl.DiagnosticInfo.italic = true
hl.DiagnosticWarn.italic = true
return hl
end

View File

@@ -1,21 +0,0 @@
return {
aerial = true,
beacon = false,
bufferline = true,
cmp = true,
dashboard = true,
highlighturl = true,
hop = false,
indent_blankline = true,
lightspeed = false,
["neo-tree"] = true,
notify = true,
["nvim-tree"] = false,
["nvim-web-devicons"] = true,
rainbow = true,
symbols_outline = false,
telescope = true,
treesitter = true,
vimwiki = false,
["which-key"] = true,
}

4
heirline/attributes.lua Normal file
View File

@@ -0,0 +1,4 @@
return {
-- styling choices for each heirline element, check possible attributes with `:h attr-list`
git_branch = { bold = true }, -- bold the git branch statusline component
}

4
heirline/colors.lua Normal file
View File

@@ -0,0 +1,4 @@
return function(colors)
colors.git_branch_fg = astronvim.get_hlgroup("Conditional").fg
return colors
end

View File

@@ -0,0 +1,8 @@
return {
breadcrumbs = false, -- LSP symbols in the breadcrumbs
file_icon = {
winbar = false, -- Filetype icon in the winbar inactive windows
statusline = true, -- Filetype icon in the statusline
tabline = true, -- Filetype icon in the tabline
},
}

5
heirline/separators.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
breadcrumbs = " > ",
tab = { "", "" },
}

9
lazy.lua Normal file
View File

@@ -0,0 +1,9 @@
return {
defaults = { lazy = true },
performance = {
rtp = {
-- customize default disabled vim plugins
disabled_plugins = { "tohtml", "gzip", "matchit", "zipPlugin", "netrwPlugin", "tarPlugin", "matchparen" },
},
},
}

6
lsp/config/denols.lua Normal file
View File

@@ -0,0 +1,6 @@
return {
denols = function(opts)
opts.root_dir = require("lspconfig.util").root_pattern("deno.json", "deno.jsonc")
return opts
end,
}

6
lsp/config/eslint.lua Normal file
View File

@@ -0,0 +1,6 @@
return {
eslint = function(opts)
opts.root_dir = require("lspconfig.util").root_pattern("package.json", ".eslintrc.json", ".eslintrc.js")
return opts
end,
}

53
lsp/config/jdtls.lua Normal file
View File

@@ -0,0 +1,53 @@
return {
jdtls = function(opts)
-- use this function notation to build some variables
local root_markers = { ".git", "mvnw", "gradlew", "pom.xml", "build.gradle" }
local root_dir = require("jdtls.setup").find_root(root_markers)
-- calculate workspace dir
local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t")
local workspace_dir = vim.fn.stdpath "data" .. "/site/java/workspace-root/" .. project_name
os.execute("mkdir " .. workspace_dir)
-- get the mason install path
local install_path = require("mason-registry").get_package("jdtls"):get_install_path()
-- get the current OS
local os
print(os)
if vim.fn.has "macunix" then
os = "mac"
elseif vim.fn.has "win32" then
os = "win"
else
os = "linux"
end
-- return the server config
return {
cmd = {
"java",
"-Declipse.application=org.eclipse.jdt.ls.core.id1",
"-Dosgi.bundles.defaultStartLevel=4",
"-Declipse.product=org.eclipse.jdt.ls.core.product",
"-Dlog.protocol=true",
"-Dlog.level=ALL",
"-javaagent:" .. install_path .. "/lombok.jar",
"-Xms1g",
"--add-modules=ALL-SYSTEM",
"--add-opens",
"java.base/java.util=ALL-UNNAMED",
"--add-opens",
"java.base/java.lang=ALL-UNNAMED",
"-jar",
vim.fn.glob(install_path .. "/plugins/org.eclipse.equinox.launcher_*.jar"),
"-configuration",
install_path .. "/config_" .. os,
"-data",
workspace_dir,
},
root_dir = root_dir,
}
end,
}

6
lsp/config/tsserver.lua Normal file
View File

@@ -0,0 +1,6 @@
return {
tsserver = function(opts)
opts.root_dir = require("lspconfig.util").root_pattern "package.json"
return opts
end,
}

17
lsp/setup_handlers.lua Normal file
View File

@@ -0,0 +1,17 @@
return {
-- keys for a specific server name will be used for that LSP
--jdtls = function(server, opts)
-- -- custom sumneko_lua setup handler
-- require("lspconfig")["sumneko_lua"].setup(opts)
--end,
rust_analyzer = function(_, opts) require("rust-tools").setup { server = opts } end,
jdtls = function(_, opts)
vim.api.nvim_create_autocmd("Filetype", {
pattern = "java", -- autocmd to start jdtls
callback = function()
if opts.root_dir and opts.root_dir ~= "" then require("jdtls").start_or_attach(opts) end
end,
})
end,
}

View File

@@ -9,6 +9,9 @@ return {
["<leader>bt"] = { "<cmd>BufferLineSortByTabs<cr>", desc = "Sort by tabs" }, ["<leader>bt"] = { "<cmd>BufferLineSortByTabs<cr>", desc = "Sort by tabs" },
-- quick save -- quick save
-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command -- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
["<leader>b"] = { name = "Buffer" },
["<leader>P"] = { "<cmd>Telescope projects<cr>", desc = "projects" },
["<leader>."] = { "<cmd>Ranger<cr>", desc = "ranger" },
}, },
t = { t = {
-- setting a mapping to false will disable it -- setting a mapping to false will disable it

View File

@@ -17,14 +17,14 @@ return {
autoformat_enabled = true, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled) autoformat_enabled = true, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled)
icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing) icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing)
ui_notifications_enabled = true, -- disable notifications when toggling UI elements ui_notifications_enabled = true, -- disable notifications when toggling UI elements
heirline_bufferline = false, -- enable new heirline based bufferline (requires :PackerSync after changing) --heirline_bufferline = true, -- enable new heirline based bufferline (requires :PackerSync after changing)
vim_markdown_folding_disabled = 1, --vim_markdown_folding_disabled = 1,
vim_markdown_conceal = 1, --vim_markdown_conceal = 1,
tex_conceal = "", --tex_conceal = "",
vim_markdown_math = 1, --vim_markdown_math = 1,
vim_markdown_frontmatter = 1, --vim_markdown_frontmatter = 1,
vim_markdown_toml_frontmatter = 1, --vim_markdown_toml_frontmatter = 1,
vim_markdown_json_frontmatter = 1, --vim_markdown_json_frontmatter = 1,
}, },
} }

4
plugins/crates-nvim.lua Normal file
View File

@@ -0,0 +1,4 @@
return {
"Saecki/crates.nvim",
config = function() require("crates").setup() end,
}

8
plugins/heirline.lua Normal file
View File

@@ -0,0 +1,8 @@
return {
"rebelot/heirline.nvim",
opts = function(_, opts)
opts.tabline[2] =
astronvim.status.heirline.make_buflist(astronvim.status.component.tabline_file_info { close_button = false })
return opts
end,
}

View File

@@ -1,119 +0,0 @@
return {
{
"nvim-telescope/telescope-file-browser.nvim",
after = "telescope.nvim",
config = function() require("telescope").load_extension "file_browser" end,
},
--{
-- "ahmedkhalf/project.nvim",
-- after = "telescope.nvim",
-- config = function()
-- require("project_nvim").setup {
-- -- Manual mode doesn't automatically change your root directory, so you have
-- -- the option to manually do so using `:ProjectRoot` command.
-- manual_mode = false,
-- -- Methods of detecting the root directory. **"lsp"** uses the native neovim
-- -- lsp, while **"pattern"** uses vim-rooter like glob pattern matching. Here
-- -- order matters: if one is not detected, the other is used as fallback. You
-- -- can also delete or rearangne the detection methods.
-- detection_methods = { "lsp", "pattern" },
-- -- All the patterns used to detect root dir, when **"pattern"** is in
-- -- detection_methods
-- patterns = { ".git", "Makefile", "package.json" },
-- -- Table of lsp clients to ignore by name
-- -- eg: { "efm", ... }
-- ignore_lsp = {},
-- -- Don't calculate root dir on specific directories
-- -- Ex: { "~/.cargo/*", ... }
-- exclude_dirs = {},
-- -- Show hidden files in telescope
-- show_hidden = false,
-- -- When set to false, you will get a message when project.nvim changes your
-- -- directory.
-- silent_chdir = true,
-- -- What scope to change the directory, valid options are
-- -- * global (default)
-- -- * tab
-- -- * win
-- scope_chdir = "global",
-- -- Path where project.nvim will store the project history for use in
-- -- telescope
-- datapath = vim.fn.stdpath "data",
-- }
-- require("telescope").load_extension "projects"
-- end,
--},
{
after = "telescope.nvim",
"pwntester/octo.nvim",
config = function() require("octo").setup() end,
},
--{
-- "~/git/git.front.kjuulh.io/kjuulh/github-presense",
-- config = function() require("github_presence").setup {} end,
--},
{
"~/git/git.front.kjuulh.io/kjuulh/ranger.nvim",
config = function() require("ranger").setup {} end,
},
{
"~/git/git.front.kjuulh.io/kjuulh/dataviewjs.nvim",
after = "nvim-treesitter",
config = function() require("dataviewjs").init {} end,
},
{
"iamcco/markdown-preview.nvim",
run = function() vim.fn["mkdp#util#install"]() end,
},
{
"godlygeek/tabular",
},
{
"elzr/vim-json",
},
{
"plasticboy/vim-markdown",
},
{
"folke/tokyonight.nvim",
},
{ "scalameta/nvim-metals", requires = { "nvim-lua/plenary.nvim" } },
{
"leoluz/nvim-dap-go",
config = function()
require("dap-go").setup {
-- Additional dap configurations can be added.
-- dap_configurations accepts a list of tables where each entry
-- represents a dap configuration. For more details do:
-- :help dap-configuration
dap_configurations = {
{
-- Must be "go" or it will be ignored by the plugin
type = "go",
name = "Attach remote",
mode = "remote",
request = "attach",
},
},
-- delve configurations
delve = {
-- time to wait for delve to initialize the debug session.
-- default to 20 seconds
initialize_timeout_sec = 20,
-- a string that defines the port to start delve debugger.
-- default to string "${port}" which instructs nvim-dap
-- to start the process in a random available port
port = "${port}",
},
}
end,
},
}

View File

@@ -1,3 +1,7 @@
return { return {
ensure_installed = { "sumneko_lua", "rust_analyzer", "gopls", "yamlls" }, "williamboman/mason-lspconfig.nvim",
opts = {
ensure_installed = { "sumneko_lua", "gopls", "yamlls", "tsserver", "terraformls", "jsonls", "jdtls" },
automatic_installation = { exclude = { "rust_analyzer" } },
},
} }

View File

@@ -1,3 +1,36 @@
return { -- overrides `require("mason-null-ls").setup(...)` return { -- overrides `require("mason-null-ls").setup(...)`
ensure_installed = { "prettier", "stylua" }, "jay-babu/mason-null-ls.nvim",
config = function(_, opts)
local mason_null_ls = require("mason-null-ls")
local null_ls = require "null-ls"
mason_null_ls.setup(opts)
mason_null_ls.setup_handlers { -- setup custom handlers
prettier = function()
require("null-ls").register(null_ls.builtins.formatting.prettier.with {
condition = function(utils)
return utils.root_has_file "package.json"
or utils.root_has_file ".prettierrc"
or utils.root_has_file ".prettierrc.json"
or utils.root_has_file ".prettierrc.js"
end,
})
end,
-- For prettierd:
-- prettierd = function()
-- require("null-ls").register(require("null-ls").builtins.formatting.prettierd.with({
-- condition = function(utils)
-- return utils.root_has_file("package.json") or utils.root_has_file(".prettierrc") or utils.root_has_file(".prettierrc.json") or utils.root_has_file(".prettierrc.js")
-- end
-- }))
-- end,
-- For eslint_d:
-- eslint_d = function()
-- require("null-ls").register(require("null-ls").builtins.diagnostics.eslint_d.with({
-- condition = function(utils)
-- return utils.root_has_file("package.json") or utils.root_has_file(".eslintrc.json") or utils.root_has_file(".eslintrc.js")
-- end
-- }))
-- end,
}
end,
} }

View File

@@ -0,0 +1,31 @@
return {
"jay-babu/mason-nvim-dap.nvim",
config = function(_, opts)
-- do more configuration as needed
local mason_nvim_dap = require "mason-nvim-dap"
mason_nvim_dap.setup(opts)
mason_nvim_dap.setup_handlers {
python = function(source_name)
local dap = require "dap"
dap.adapters.python = {
type = "executable",
command = "/usr/bin/python3",
args = {
"-m",
"debugpy.adapter",
},
}
dap.configurations.python = {
{
type = "python",
request = "launch",
name = "Launch file",
program = "${file}", -- This configuration will launch the current file if used.
},
}
end,
}
end,
}

View File

@@ -1,31 +1,29 @@
return function(config) -- overrides `require("null-ls").setup(config)` return {
-- config variable is the default configuration table for the setup function call "jose-elias-alvarez/null-ls.nvim",
local null_ls = require "null-ls" opts = function(_, config)
local null_ls = require "null-ls"
-- Check supported formatters and linters config.sources = {
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting -- Set a formatter
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics null_ls.builtins.formatting.stylua,
config.sources = { null_ls.builtins.formatting.prettier,
-- Set a formatter null_ls.builtins.formatting.deno_fmt.with {
null_ls.builtins.formatting.stylua, filetypes = { "markdown" },
null_ls.builtins.formatting.prettier, },
null_ls.builtins.formatting.deno_fmt.with { null_ls.builtins.formatting.csharpier,
filetypes = { "markdown" }, null_ls.builtins.diagnostics.sqlfluff.with {
}, extra_args = {
null_ls.builtins.formatting.csharpier, "--dialect",
null_ls.builtins.diagnostics.sqlfluff.with { "postgres",
extra_args = { "--config",
"--dialect", "/Users/kah/.config/sqlfluff/sqlc/config.toml",
"postgres", }, -- change to your dialect
"--config", },
"/Users/kah/.config/sqlfluff/sqlc/config.toml", null_ls.builtins.formatting.gofumpt,
}, -- change to your dialect null_ls.builtins.formatting.goimports,
}, null_ls.builtins.formatting.goimports_reviser,
null_ls.builtins.formatting.gofumpt, null_ls.builtins.formatting.golines,
null_ls.builtins.formatting.goimports, --null_ls.builtins.formatting.pg_format,
null_ls.builtins.formatting.goimports_reviser, }
null_ls.builtins.formatting.golines, return config -- return final config table
--null_ls.builtins.formatting.pg_format, end,
} }
return config -- return final config table
end

24
plugins/nvim-cmp.lua Normal file
View File

@@ -0,0 +1,24 @@
return {
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-emoji", -- add cmp source as dependency of cmp
},
-- override the options table that is used in the `require("cmp").setup()` call
opts = function(_, opts)
-- opts parameter is the default options table
-- the function is lazy loaded so cmp is able to be required
local cmp = require "cmp"
-- modify the sources part of the options table
opts.sources = cmp.config.sources {
{ name = "nvim_lsp", priority = 1000 },
{ name = "luasnip", priority = 750 },
{ name = "buffer", priority = 500 },
{ name = "path", priority = 250 },
{ name = "emoji", priority = 700 }, -- add new source
{ name = "crates", priority = 1000 },
}
-- return the new table to be used
return opts
end,
}

30
plugins/nvim-dap-go.lua Normal file
View File

@@ -0,0 +1,30 @@
return {
"leoluz/nvim-dap-go",
config = function()
require("dap-go").setup {
-- Additional dap configurations can be added.
-- dap_configurations accepts a list of tables where each entry
-- represents a dap configuration. For more details do:
-- :help dap-configuration
dap_configurations = {
{
-- Must be "go" or it will be ignored by the plugin
type = "go",
name = "Attach remote",
mode = "remote",
request = "attach",
},
},
-- delve configurations
delve = {
-- time to wait for delve to initialize the debug session.
-- default to 20 seconds
initialize_timeout_sec = 20,
-- a string that defines the port to start delve debugger.
-- default to string "${port}" which instructs nvim-dap
-- to start the process in a random available port
port = "${port}",
},
}
end,
}

3
plugins/nvim-jdtls.lua Normal file
View File

@@ -0,0 +1,3 @@
return {
"mfussenegger/nvim-jdtls", -- load jdtls on module
}

4
plugins/nvim-metals.lua Normal file
View File

@@ -0,0 +1,4 @@
return {
"scalameta/nvim-metals",
dependencies = { "nvim-lua/plenary.nvim" },
}

View File

@@ -0,0 +1,5 @@
return {
"nvim-telescope/telescope-file-browser.nvim",
after = "telescope.nvim",
config = function() require("telescope").load_extension "file_browser" end,
}

6
plugins/octo.lua Normal file
View File

@@ -0,0 +1,6 @@
return {
after = "telescope.nvim",
"pwntester/octo.nvim",
event = "UIEnter",
config = function() require("octo").setup() end,
}

5
plugins/ranger-nvim.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
"kjuulh/ranger.nvim",
event = "UIEnter",
config = function() require("ranger").setup {} end,
}

3
plugins/rust-tools.lua Normal file
View File

@@ -0,0 +1,3 @@
return {
"simrat39/rust-tools.nvim",
}

3
plugins/tabular.lua Normal file
View File

@@ -0,0 +1,3 @@
return {
"godlygeek/tabular",
}

3
plugins/tokyonight.lua Normal file
View File

@@ -0,0 +1,3 @@
return {
"folke/tokyonight.nvim",
}

View File

@@ -0,0 +1,12 @@
return { -- overrides `require("treesitter").setup(...)`
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"lua",
"rust",
"markdown",
"typescript",
"go",
},
},
}

3
plugins/vim-json.lua Normal file
View File

@@ -0,0 +1,3 @@
return {
"elzr/vim-json",
}

3
plugins/vim-markdown.lua Normal file
View File

@@ -0,0 +1,3 @@
return {
"plasticboy/vim-markdown",
}

View File

@@ -1,17 +1,20 @@
return { return {
remote = "origin", -- remote to use --remote = "origin", -- remote to use
channel = "stable", -- "stable" or "nightly" --channel = "stable", -- "stable" or "nightly"
version = "latest", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY) channel = "nightly", -- "stable" or "nightly"
--branch = "main", -- branch name (NIGHTLY ONLY) --version = "v2.11.7", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY)
commit = nil, -- commit hash (NIGHTLY ONLY) --version="latest",
pin_plugins = nil, -- nil, true, false (nil will pin plugins on stable only) branch = "v3", -- branch name (NIGHTLY ONLY)
--commit = nil, -- commit hash (NIGHTLY ONLY)
--pin_plugins = nil, -- nil, true, false (nil will pin plugins on stable only)
skip_prompts = false, -- skip prompts about breaking changes skip_prompts = false, -- skip prompts about breaking changes
show_changelog = true, -- show the changelog after performing an update show_changelog = true, -- show the changelog after performing an update
auto_reload = false, -- automatically reload and sync packer after a successful update auto_reload = false, -- automatically reload and sync packer after a successful update
auto_quit = false, -- automatically quit the current session after a successful update auto_quit = false, -- automatically quit the current session after a successful update
-- remotes = { -- easily add new remotes to track remotes = { -- easily add new remotes to track
-- ["remote_name"] = "https://remote_url.come/repo.git", -- full remote url ["kjuulh/ranger.nvim"] = "https://git.front.kjuulh.io/kjuulh/ranger.nvim.git", -- full remote url
-- ["remote2"] = "github_user/repo", -- GitHub user/repo shortcut, ["kjuulh/dataviewjs"] = "https://git.front.kjuulh.io/kjuulh/dataviewjs.nvim.git", -- full remote url
-- ["remote3"] = "github_user", -- GitHub user assume AstroNvim fork -- ["remote2"] = "github_user/repo", -- GitHub user/repo shortcut,
-- }, -- ["remote3"] = "github_user", -- GitHub user assume AstroNvim fork
},
} }

View File

@@ -1,13 +0,0 @@
return {
-- first key is the mode, n == normal mode
n = {
-- second key is the prefix, <leader> prefixes
["<leader>"] = {
-- third key is the key to bring up next level and its displayed
-- group name in which-key top level menu
["b"] = { name = "Buffer" },
["P"] = { "<cmd>Telescope projects<cr>", "projects" },
["."] = { "<cmd>Ranger<cr>", "ranger" },
},
},
}