Rename plugin dir
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/windwp/nvim-autopairs
|
||||
|
||||
require("nvim-autopairs").setup()
|
||||
@@ -0,0 +1,6 @@
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<C-w>q",
|
||||
":Bwipeout<CR>",
|
||||
{ remap = false, silent = true, }
|
||||
)
|
||||
@@ -0,0 +1,157 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/hrsh7th/nvim-cmp
|
||||
|
||||
local has_words_before = function ()
|
||||
unpack = unpack or table.unpack
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
end
|
||||
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
local lspkind = require("lspkind")
|
||||
|
||||
cmp.setup({
|
||||
enabled = function ()
|
||||
-- disable completion in comments
|
||||
local context = require "cmp.config.context"
|
||||
-- keep command mode completion enabled when cursor is in a comment
|
||||
if vim.api.nvim_get_mode().mode == "c" then
|
||||
return true
|
||||
else
|
||||
return not context.in_treesitter_capture("comment") and
|
||||
not context.in_syntax_group("Comment")
|
||||
end
|
||||
end,
|
||||
completion = { keyword_length = 3, },
|
||||
snippet = {
|
||||
expand = function (args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
formatting = {
|
||||
format = function (entry, vim_item)
|
||||
vim_item = lspkind.cmp_format({
|
||||
mode = "text",
|
||||
maxwidth = 50,
|
||||
ellipsis_char = "...",
|
||||
})(entry, vim_item)
|
||||
|
||||
vim_item.dup = 0
|
||||
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
experimental = { ghost_text = true, },
|
||||
mapping = {
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-e>"] = cmp.mapping.close(),
|
||||
["<CR>"] = cmp.mapping(
|
||||
function (fallback)
|
||||
if cmp.visible() then
|
||||
cmp.confirm(
|
||||
{
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
}
|
||||
)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s", }
|
||||
),
|
||||
["<Tab>"] = cmp.mapping(
|
||||
function (fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s", }
|
||||
),
|
||||
["<S-Tab>"] = cmp.mapping(
|
||||
function (fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s", }
|
||||
),
|
||||
["<Down>"] = cmp.mapping(
|
||||
function (fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s", }
|
||||
),
|
||||
["<Up>"] = cmp.mapping(
|
||||
function (fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s", }
|
||||
),
|
||||
},
|
||||
sources = {
|
||||
{ name = "nvim_lsp", },
|
||||
{ name = "luasnip", },
|
||||
{ name = "path", },
|
||||
-- { name = 'buffer' },
|
||||
-- { name = 'nvim_lsp_signature_help' },
|
||||
-- { name = 'nvim_lua' },
|
||||
},
|
||||
})
|
||||
|
||||
cmp.setup.cmdline(
|
||||
"/",
|
||||
{
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = { { name = "buffer", }, },
|
||||
}
|
||||
)
|
||||
|
||||
cmp.setup.cmdline(
|
||||
":",
|
||||
{
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources(
|
||||
{ { name = "path", }, },
|
||||
{ { name = "cmdline", option = { ignore_cmds = { "Man", "!", }, }, }, }
|
||||
),
|
||||
}
|
||||
)
|
||||
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
cmp.event:on(
|
||||
"confirm_done",
|
||||
cmp_autopairs.on_confirm_done()
|
||||
)
|
||||
@@ -0,0 +1,24 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/numToStr/Comment.nvim
|
||||
|
||||
require("Comment").setup(
|
||||
{
|
||||
--ignore empty lines
|
||||
ignore = "^$",
|
||||
}
|
||||
)
|
||||
@@ -0,0 +1,98 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/mfussenegger/nvim-dap
|
||||
|
||||
vim.fn.execute("nnoremap <silent> <F5> :lua require'dap'.continue()<CR>")
|
||||
vim.fn.execute("nnoremap <silent> <F10> :lua require'dap'.step_over()<CR>")
|
||||
vim.fn.execute("nnoremap <silent> <F11> :lua require'dap'.step_into()<CR>")
|
||||
vim.fn.execute("nnoremap <silent> <F12> :lua require'dap'.step_out()<CR>")
|
||||
vim.fn.execute("nnoremap <leader>dt :lua require'plugin.config.dap'.pytest({'-k', ''})<left><left><left>")
|
||||
vim.fn.execute("nnoremap <leader>dl :lua require'plugin.config.dap'.launch({''})<left><left><left>")
|
||||
vim.fn.execute("nnoremap <silent> <leader>db :lua require'dap'.toggle_breakpoint()<CR>")
|
||||
-- vim.fn.execute("nnoremap <silent> <leader>B :lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>")
|
||||
-- vim.fn.execute("nnoremap <silent> <leader>lp :lua require'dap'.set_breakpoint(nil, nil, vim.fn.input('Log point message: '))<CR>")
|
||||
vim.fn.execute("nnoremap <silent> <leader>dr :lua require'dap'.repl.open()<CR>")
|
||||
-- vim.fn.execute("nnoremap <silent> <leader>dl :lua require'dap'.run_last()<CR>")
|
||||
|
||||
local utils = require("utils")
|
||||
|
||||
local M = {}
|
||||
|
||||
local env_ok = false
|
||||
local dap = nil
|
||||
|
||||
local function check_env()
|
||||
utils.assert_installed("python3")
|
||||
utils.assert_python3_module_installed("debugpy")
|
||||
env_ok = true
|
||||
end
|
||||
|
||||
local function start(config)
|
||||
if not env_ok then
|
||||
check_env()
|
||||
end
|
||||
if not dap then
|
||||
dap = require("dap")
|
||||
dap.adapters.python = {
|
||||
type = "executable",
|
||||
command = "python",
|
||||
args = { "-m", "debugpy.adapter", },
|
||||
cwd = vim.fn.getcwd(),
|
||||
}
|
||||
end
|
||||
dap.run(config)
|
||||
-- List of events described at https://microsoft.github.io/debug-adapter-protocol/specification#Events
|
||||
-- Also see :h dap-extensions
|
||||
dap.listeners.after["event_initialized"]["nvim-dap.lua"] = function ()
|
||||
dap.set_exception_breakpoints({ "userUnhandled", })
|
||||
end
|
||||
end
|
||||
|
||||
function M.launch(args)
|
||||
assert(type(args) == "table", "Args not specified or of wrong type")
|
||||
local config = {
|
||||
name = "Launch file",
|
||||
type = "python",
|
||||
request = "launch",
|
||||
program = "${file}",
|
||||
-- python = 'python';
|
||||
-- program = vim.fn.getcwd() .. '/.venv/bin/pytest';
|
||||
console = "integratedTerminal",
|
||||
args = args,
|
||||
}
|
||||
start(config)
|
||||
end
|
||||
|
||||
function M.pytest(args)
|
||||
assert(type(args) == "table", "Args not specified or of wrong type")
|
||||
local config = {
|
||||
name = "pytest " .. table.concat(args, " "),
|
||||
type = "python",
|
||||
request = "launch",
|
||||
|
||||
-- pythonPath = vim.fn.getcwd() .. '/.venv/bin/python',
|
||||
module = "pytest",
|
||||
-- python = 'python';
|
||||
-- program = vim.fn.getcwd() .. '/.venv/bin/pytest';
|
||||
args = args,
|
||||
console = "integratedTerminal",
|
||||
-- program = "${file}";
|
||||
}
|
||||
start(config)
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -0,0 +1,59 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/rcarriga/nvim-dap-ui
|
||||
|
||||
require("dapui").setup({
|
||||
icons = { expanded = "▾", collapsed = "▸", },
|
||||
mappings = {
|
||||
-- Use a table to apply multiple mappings
|
||||
expand = { "<CR>", "<2-LeftMouse>", },
|
||||
open = "o",
|
||||
remove = "d",
|
||||
edit = "e",
|
||||
repl = "r",
|
||||
toggle = "t",
|
||||
},
|
||||
layouts = {
|
||||
{
|
||||
elements = {
|
||||
"scopes",
|
||||
"breakpoints",
|
||||
"stacks",
|
||||
"watches",
|
||||
},
|
||||
size = 40,
|
||||
position = "left",
|
||||
},
|
||||
{
|
||||
elements = {
|
||||
"repl",
|
||||
"console",
|
||||
},
|
||||
size = 10,
|
||||
position = "bottom",
|
||||
},
|
||||
},
|
||||
floating = {
|
||||
max_height = nil, -- These can be integers or a float between 0 and 1.
|
||||
max_width = nil, -- Floats will be treated as percentage of your screen.
|
||||
border = "single", -- Border style. Can be "single", "double" or "rounded"
|
||||
mappings = {
|
||||
close = { "q", "<Esc>", },
|
||||
},
|
||||
},
|
||||
windows = { indent = 1, },
|
||||
})
|
||||
@@ -0,0 +1,19 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/rbong/vim-flog
|
||||
|
||||
vim.keymap.set("n", "<leader>gl", ":Flog<CR>", { remap = false, silent = true, })
|
||||
@@ -0,0 +1,27 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/tpope/vim-fugitive
|
||||
|
||||
local function git_status_tab()
|
||||
vim.fn.execute("tabnew")
|
||||
vim.fn.execute("leftabove vertical G")
|
||||
vim.fn.execute("vertical resize 60 | set wfw")
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "<leader>gd", ":Gdiffsplit<CR>", { remap = false, })
|
||||
vim.keymap.set("n", "<leader>gg", git_status_tab, { silent = true, remap = false, })
|
||||
vim.keymap.set("n", "<leader>gc", ":G commit<CR>", { remap = false, })
|
||||
@@ -0,0 +1,38 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/lewis6991/gitsigns.nvim
|
||||
|
||||
local function map(bufnr, mode, l, r, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = bufnr
|
||||
vim.keymap.set(mode, l, r, opts)
|
||||
end
|
||||
|
||||
require("gitsigns").setup({
|
||||
on_attach = function (bufnr)
|
||||
local gs = package.loaded.gitsigns
|
||||
map(bufnr, "n", "<leader>gv", gs.select_hunk)
|
||||
map(bufnr, { "n", "x", }, "<leader>gr", ":Gitsigns reset_hunk<CR>") -- gs.reset_hunk() doesn't work with selected lines
|
||||
map(bufnr, "n", "<leader>g?", gs.preview_hunk)
|
||||
map(bufnr, "n", "<leader>gb", function ()
|
||||
gs.blame_line { full = true, }
|
||||
end)
|
||||
end,
|
||||
signs = {
|
||||
untracked = { text = "│", },
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,23 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
require("indent_blankline").setup {
|
||||
use_treesitter = true,
|
||||
show_first_indent_level = false,
|
||||
show_trailing_blankline_indent = false,
|
||||
show_current_context = true,
|
||||
max_indent_increase = 1
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/ray-x/lsp_signature.nvim
|
||||
|
||||
require("lsp_signature").setup()
|
||||
@@ -0,0 +1,45 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/nvim-lualine/lualine.nvim
|
||||
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "auto",
|
||||
component_separators = { left = "", right = "", },
|
||||
section_separators = { left = "", right = "", },
|
||||
disabled_filetypes = { "NvimTree", "fugitive", },
|
||||
always_divide_middle = true,
|
||||
globalstatus = true,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = { "mode", },
|
||||
lualine_c = { { "filename", path = 1, }, "diff", { "diagnostics", sources = { "nvim_lsp", }, }, },
|
||||
lualine_x = { "filetype", "encoding", "fileformat", "progress", },
|
||||
lualine_y = { "location", },
|
||||
lualine_z = {},
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename", },
|
||||
lualine_x = { "location", },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,19 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/L3MON4D3/LuaSnip
|
||||
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
@@ -0,0 +1,19 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/williamboman/mason.nvim
|
||||
|
||||
require("mason").setup()
|
||||
@@ -0,0 +1,24 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/williamboman/mason-lspconfig.nvim
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
-- A list of servers to automatically install if they're not already installed. Example: { "rust_analyzer@nightly", "lua_ls" }
|
||||
-- This setting has no relation with the `automatic_installation` setting.
|
||||
---@type string[]
|
||||
ensure_installed = require("lsp"):language_servers(),
|
||||
})
|
||||
@@ -0,0 +1,19 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/RubixDev/mason-update-all
|
||||
|
||||
require("mason-update-all").setup()
|
||||
@@ -0,0 +1,44 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/nvim-neorg/neorg
|
||||
|
||||
require("neorg").setup({
|
||||
load = {
|
||||
["core.defaults"] = {},
|
||||
["core.concealer"] = {},
|
||||
["core.keybinds"] = {
|
||||
config = {
|
||||
hook = function (keybinds)
|
||||
keybinds.remap_event("norg", "n", keybinds.leader .. "tt", "core.qol.todo_items.todo.task_cycle")
|
||||
end,
|
||||
},
|
||||
},
|
||||
["core.dirman"] = {
|
||||
config = {
|
||||
workspaces = {
|
||||
notes = "~/Documents/notes",
|
||||
},
|
||||
},
|
||||
},
|
||||
["core.completion"] = {
|
||||
config = {
|
||||
engine = "nvim-cmp",
|
||||
},
|
||||
},
|
||||
["core.export"] = {},
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,25 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/rcarriga/nvim-notify
|
||||
|
||||
local telescope = require("telescope")
|
||||
|
||||
vim.notify = require("notify")
|
||||
telescope.load_extension("notify")
|
||||
vim.keymap.set(
|
||||
"n", "<leader>fn", function () telescope.extensions.notify.notify() end
|
||||
)
|
||||
@@ -0,0 +1,36 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/nvim-telescope/telescope.nvim
|
||||
|
||||
local builtin = require("telescope.builtin")
|
||||
|
||||
vim.keymap.set(
|
||||
"n", "<leader>ff", function () builtin.find_files({ hidden = true, }) end
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n", "<leader>fr", function () builtin.oldfiles({ hidden = true, }) end
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n", "<leader>fg", function ()
|
||||
builtin.live_grep(
|
||||
{ additional_args = function (_) return { "--hidden", } end, }
|
||||
)
|
||||
end
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n", "<leader>fb", function () builtin.buffers() end
|
||||
)
|
||||
@@ -0,0 +1,64 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/nvim-tree/nvim-tree.lua
|
||||
|
||||
require("nvim-tree").setup({
|
||||
sync_root_with_cwd = true,
|
||||
view = {
|
||||
width = 40,
|
||||
preserve_window_proportions = true,
|
||||
},
|
||||
renderer = {
|
||||
add_trailing = true,
|
||||
group_empty = true,
|
||||
highlight_git = true,
|
||||
indent_markers = {
|
||||
enable = true,
|
||||
},
|
||||
icons = {
|
||||
git_placement = "after",
|
||||
show = {
|
||||
folder_arrow = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_root = true,
|
||||
ignore_list = {
|
||||
"help",
|
||||
},
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
show_on_dirs = false,
|
||||
},
|
||||
actions = {
|
||||
change_dir = {
|
||||
enable = false,
|
||||
},
|
||||
open_file = {
|
||||
resize_window = true,
|
||||
},
|
||||
},
|
||||
filters = {
|
||||
custom = { "^\\.git$", },
|
||||
},
|
||||
})
|
||||
|
||||
local opts = { remap = false, silent = true, }
|
||||
vim.keymap.set("n", "<leader>tt", function () require("nvim-tree.api").tree.toggle() end, opts)
|
||||
@@ -0,0 +1,35 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/nvim-treesitter/nvim-treesitter
|
||||
|
||||
require("nvim-treesitter.configs").setup({
|
||||
auto_install = true,
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
|
||||
-- Indentation based on treesitter for the = operator.
|
||||
-- NOTE: This is an experimental feature.
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
||||
|
||||
vim.opt.foldmethod = "expr"
|
||||
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
vim.opt.foldenable = false
|
||||
@@ -0,0 +1,28 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/Mofiqul/vscode.nvim
|
||||
|
||||
local vscode = require("vscode")
|
||||
|
||||
vscode.setup({
|
||||
style = "dark",
|
||||
transparent = false,
|
||||
italic_comments = false,
|
||||
disable_nvimtree_bg = false,
|
||||
})
|
||||
|
||||
vscode.load()
|
||||
@@ -0,0 +1,24 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/simeji/winresizer
|
||||
|
||||
vim.g.winresizer_vert_resize = "5"
|
||||
vim.g.winresizer_horiz_resize = "5"
|
||||
vim.g.winresizer_start_key = ""
|
||||
|
||||
local opts = { remap = false, silent = true, }
|
||||
vim.keymap.set("n", "<C-W>r", ":WinResizerStartResize<CR>", opts)
|
||||
@@ -0,0 +1,19 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
-- https://github.com/sindrets/winshift.nvim
|
||||
|
||||
vim.keymap.set("n", "<C-W>m", ":WinShift<CR>", { remap = false, })
|
||||
@@ -0,0 +1,195 @@
|
||||
--[[
|
||||
Copyright 2023 Oscar Wallberg
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
]]
|
||||
|
||||
vim.loader.enable()
|
||||
|
||||
local plugins = {
|
||||
{
|
||||
"Mofiqul/vscode.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
config = function () require("plugins.config.vscode") end,
|
||||
},
|
||||
{
|
||||
"rcarriga/nvim-notify",
|
||||
priority = 900,
|
||||
config = function () require("plugins.config.notify") end,
|
||||
},
|
||||
{
|
||||
"rafamadriz/friendly-snippets",
|
||||
},
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
config = function () require("plugins.config.luasnip") end,
|
||||
-- comment out on windows and install jsregexp manually
|
||||
build = "make install_jsregexp",
|
||||
version = "2.*",
|
||||
},
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
config = function () require("plugins.config.autopairs") end,
|
||||
},
|
||||
{
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
},
|
||||
{
|
||||
"hrsh7th/cmp-buffer",
|
||||
},
|
||||
{
|
||||
"hrsh7th/cmp-path",
|
||||
},
|
||||
{
|
||||
"hrsh7th/cmp-cmdline",
|
||||
},
|
||||
{
|
||||
"onsails/lspkind-nvim",
|
||||
},
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
config = function () require("plugins.config.cmp") end,
|
||||
},
|
||||
{
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
config = function () require("plugins.config.mason") end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
config = function () require("plugins.config.mason_lspconfig") end,
|
||||
},
|
||||
{
|
||||
"ray-x/lsp_signature.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function () require("plugins.config.lsp_signature") end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function () require("lsp"):setup() end,
|
||||
lazy = true,
|
||||
ft = require("lsp"):filetypes(),
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
config = function () require("plugins.config.treesitter") end,
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
config = function () require("plugins.config.dap") end,
|
||||
lazy = true,
|
||||
ft = require("lsp"):filetypes(),
|
||||
},
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
config = function () require("plugins.config.dap_ui") end,
|
||||
},
|
||||
{
|
||||
"kyazdani42/nvim-web-devicons",
|
||||
},
|
||||
{
|
||||
"tpope/vim-fugitive",
|
||||
config = function () require("plugins.config.fugitive") end,
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
},
|
||||
{
|
||||
"rbong/vim-flog",
|
||||
config = function () require("plugins.config.flog") end,
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
config = function () require("plugins.config.lualine") end,
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
},
|
||||
{
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
config = function () require("plugins.config.gitsigns") end,
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
config = function () require("plugins.config.telescope") end,
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
},
|
||||
{
|
||||
"numToStr/Comment.nvim",
|
||||
config = function () require("plugins.config.comment") end,
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
},
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
config = function () require("plugins.config.indent-blankline") end,
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
},
|
||||
{
|
||||
"simeji/winresizer",
|
||||
config = function () require("plugins.config.winresizer") end,
|
||||
lazy = true,
|
||||
keys = { "<C-W>r", },
|
||||
},
|
||||
{
|
||||
"sindrets/winshift.nvim",
|
||||
config = function () require("plugins.config.winshift") end,
|
||||
lazy = true,
|
||||
keys = { "<C-W>m", },
|
||||
},
|
||||
{
|
||||
"martinda/Jenkinsfile-vim-syntax",
|
||||
lazy = true,
|
||||
ft = { "jenkinsfile", "Jenkinsfile", },
|
||||
},
|
||||
{
|
||||
"kyazdani42/nvim-tree.lua",
|
||||
config = function () require("plugins.config.tree") end,
|
||||
},
|
||||
{
|
||||
"dstein64/vim-startuptime",
|
||||
lazy = true,
|
||||
event = "VimEnter",
|
||||
},
|
||||
{
|
||||
"stevearc/aerial.nvim",
|
||||
config = function () require("plugins.config.aerial") end,
|
||||
},
|
||||
{
|
||||
"nvim-neorg/neorg",
|
||||
build = ":Neorg sync-parsers",
|
||||
config = function () require("plugins.config.neorg") end,
|
||||
},
|
||||
{
|
||||
"RubixDev/mason-update-all",
|
||||
config = function () require("plugins.config.mason_update_all") end,
|
||||
},
|
||||
{
|
||||
"famiu/bufdelete.nvim",
|
||||
config = function () require("plugins.config.bufdelete") end,
|
||||
},
|
||||
}
|
||||
|
||||
local opts = {}
|
||||
|
||||
require("lazy").setup(plugins, opts)
|
||||
Reference in New Issue
Block a user