Restructuring
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,66 @@
|
||||
--[[
|
||||
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/akinsho/bufferline.nvim
|
||||
|
||||
--- Define what filetypes should be ignored by bufferline.
|
||||
--- Filetypes not listed are enabled by default.
|
||||
local ft_map = {
|
||||
NvimTree = false,
|
||||
fugitive = false,
|
||||
}
|
||||
|
||||
local bufferline = require("bufferline")
|
||||
bufferline.setup({
|
||||
options = {
|
||||
close_command = "Bwipeout %d",
|
||||
right_mouse_command = nil,
|
||||
middle_mouse_command = "Bwipeout %d",
|
||||
diagnostics = "nvim_lsp",
|
||||
diagnostics_update_in_insert = false,
|
||||
custom_filter = function (buf, _)
|
||||
local buf_ft = vim.bo[buf].filetype
|
||||
|
||||
if ft_map[buf_ft] == nil then
|
||||
ft_map[buf_ft] = true -- enable by default
|
||||
end
|
||||
|
||||
return ft_map[buf_ft]
|
||||
end,
|
||||
style_preset = bufferline.style_preset.no_italic,
|
||||
offsets = {
|
||||
{
|
||||
filetype = "NvimTree",
|
||||
text = "File Explorer",
|
||||
text_align = "center",
|
||||
seperator = true,
|
||||
},
|
||||
{
|
||||
filetype = "fugitive",
|
||||
text = "Fugitive",
|
||||
text_align = "center",
|
||||
seperator = true,
|
||||
},
|
||||
{
|
||||
filetype = "aerial",
|
||||
text = "Aerial",
|
||||
text_align = "center",
|
||||
seperator = true,
|
||||
},
|
||||
},
|
||||
sort_by = "id",
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,141 @@
|
||||
--[[
|
||||
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-Space>"] = cmp.mapping.complete(),
|
||||
["<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", }
|
||||
),
|
||||
},
|
||||
sources = {
|
||||
-- { name = 'buffer' },
|
||||
{ name = "path", },
|
||||
{ name = "nvim_lsp", },
|
||||
-- { name = 'nvim_lsp_signature_help' },
|
||||
-- { name = 'nvim_lua' },
|
||||
{ name = "luasnip", },
|
||||
},
|
||||
})
|
||||
|
||||
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,26 @@
|
||||
--[[
|
||||
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 | 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", "v", }, "<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,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/Yggdroot/indentLine
|
||||
|
||||
-- more options at https://www.jetbrains.com/lp/mono/
|
||||
vim.g.indentLine_char = "▏"
|
||||
-- Disable conceal for some syntax plugins
|
||||
vim.g.vim_json_conceal = 0
|
||||
vim.g.markdown_syntax_conceal = 0
|
||||
vim.g.indentLine_fileTypeExclude = { "NvimTree", }
|
||||
@@ -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,37 @@
|
||||
--[[
|
||||
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.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,65 @@
|
||||
--[[
|
||||
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,
|
||||
highlight_opened_files = "name",
|
||||
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, })
|
||||
Reference in New Issue
Block a user