switched to a submodule

This commit is contained in:
kalmenn 2023-12-18 09:11:00 +01:00
commit fdf977246d
Signed by: kalmenn
GPG key ID: DFF253360BF8471F
14 changed files with 276 additions and 0 deletions

22
init.lua Normal file
View file

@ -0,0 +1,22 @@
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require('lazy').setup({ { import = "plugins" } })
require("sets")
require("remaps")
vim.notify("starting nvim 🏕️")

17
lazy-lock.json Normal file
View file

@ -0,0 +1,17 @@
{
"barbar.nvim": { "branch": "master", "commit": "a8fe0abe538f15997a543e0f653993ef3727455f" },
"fd": { "branch": "master", "commit": "00b64f3ccbfb832ef744bb42bbdfabaf929b5ee2" },
"feline.nvim": { "branch": "main", "commit": "a6bebd903e84d5ce0e97c597e0ca85cd24109002" },
"gitsigns.nvim": { "branch": "main", "commit": "d195f0c35ced5174d3ecce1c4c8ebb3b5bc23fa9" },
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "230ff118613fa07138ba579b89d13ec2201530b9" },
"nui.nvim": { "branch": "main", "commit": "c9b4de623d19a85b353ff70d2ae9c77143abe69c" },
"nvim": { "branch": "main", "commit": "079500a625f3ae5aa6efb758f1a17fe4c7a57e52" },
"nvim-lspconfig": { "branch": "master", "commit": "e50a8fcd6267cb9b2d2a880dcf3a8ac113b75abc" },
"nvim-treesitter": { "branch": "master", "commit": "25ddfde8d7167d7d81403d6809242439037d2b68" },
"nvim-web-devicons": { "branch": "master", "commit": "a1425903ab52a0a0460622519e827f224e5b4fee" },
"plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" },
"ripgrep": { "branch": "master", "commit": "3f2fe0afee0d1a1eeb3235904cfef4f35c4644dc" },
"telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
"undotree": { "branch": "master", "commit": "36ff7abb6b60980338344982ad4cdf03f7961ecd" }
}

13
lua/plugins/barbar.lua Normal file
View file

@ -0,0 +1,13 @@
return { 'romgrk/barbar.nvim',
dependencies = {
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
},
init = function() vim.g.barbar_auto_setup = false end,
opts = {
-- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default:
-- animation = true,
-- insert_at_start = true,
-- …etc.
},
}

View file

@ -0,0 +1,13 @@
return { {
"catppuccin/nvim",
priority = 1000,
config = function()
require("catppuccin").setup({
flavour = "mocha",
integrations = {
treesitter = false,
},
})
vim.cmd.colorscheme("catppuccin")
end
} }

11
lua/plugins/feline.lua Normal file
View file

@ -0,0 +1,11 @@
return {
'freddiehaddad/feline.nvim',
opts = {},
config = function(_, opts)
require('feline').setup()
-- require('feline').winbar.setup() -- to use winbar
require('feline').statuscolumn.setup() -- to use statuscolumn
-- require('feline').use_theme() -- to use a custom theme
end
}

11
lua/plugins/gitsigns.lua Normal file
View file

@ -0,0 +1,11 @@
return {
"lewis6991/gitsigns.nvim",
config = function()
require("gitsigns").setup({
current_line_blame = true,
yadm = {
enable = true,
},
})
end
}

58
lua/plugins/lsp.lua Normal file
View file

@ -0,0 +1,58 @@
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev)
-- Enable completion triggered by <c-x><c-o>
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
-- Buffer local mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = { buffer = ev.buf }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
vim.keymap.set('n', '<space>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, opts)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
vim.keymap.set('n', '<space>f', function()
vim.lsp.buf.format { async = true }
end, opts)
end,
})
return {
"neovim/nvim-lspconfig",
config = function()
local lspconfig = require("lspconfig")
lspconfig.pyright.setup({})
lspconfig.rust_analyzer.setup({})
lspconfig.lua_ls.setup({
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
},
},
})
end
}

32
lua/plugins/neo-tree.lua Normal file
View file

@ -0,0 +1,32 @@
-- TODO: set keymaps
return {
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
},
lazy = false,
config = function()
require('neo-tree').setup({
filesystem = {
filtered_items = {
visible = true,
},
},
window = {
position = "right",
width = 30,
},
})
end,
keys = {
{ "<C-N>t", "<cmd>Neotree toggle<cr>", "Toggle Neotree" },
{ "<C-N>f", "<cmd>Neotree filesystem focus<cr>", "Focus filesystem in Neotree" },
{ "<C-N>b", "<cmd>Neotree buffers focus<cr>", "Focus buffers in Neotree" },
{ "<C-N>g", "<cmd>Neotree git_status focus<cr>", "Focus git status in Neotree" },
},
}

16
lua/plugins/telescope.lua Normal file
View file

@ -0,0 +1,16 @@
return {
"nvim-telescope/telescope.nvim",
branch = "0.1.x",
dependencies = {
"BurntSushi/ripgrep",
"nvim-lua/plenary.nvim",
"sharkdp/fd",
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons",
},
keys = {
{ "<C-t>f", "<cmd>Telescope find_files<cr>", desc = "Fuzzy find files with Telescope" },
{ "<C-p>", "<cmd>Telescope find_files<cr>", desc = "Fuzzy find files with Telescope" },
{ "<C-t>b", "<cmd>Telescope buffers<cr>", desc = "Fuzzy find open buffers with Telescope" },
}
}

View file

@ -0,0 +1,16 @@
return {
"nvim-treesitter/nvim-treesitter",
config = function()
require('nvim-treesitter.configs').setup({
modules = {},
ensure_installed = { "lua", "rust" },
sync_install = false,
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
ignore_install = {},
})
end
}

12
lua/plugins/undotree.lua Normal file
View file

@ -0,0 +1,12 @@
return {
"mbbill/undotree",
keys = {
{
"<A-u>",
function()
vim.cmd.UndotreeToggle();
vim.cmd.UndotreeFocus();
end
},
},
}

12
lua/remaps.lua Normal file
View file

@ -0,0 +1,12 @@
-- move selected lines and auto indent
vim.keymap.set("v", "<A-j>", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "<A-k>", ":m '<-2<CR>gv=gv")
-- zz centers the cursor
vim.keymap.set("n", "<C-d>", "<C-d>zz")
vim.keymap.set("n", "<C-u>", "<C-u>zz")
vim.keymap.set("n", "n", "nzzzv")
vim.keymap.set("n", "N", "Nzzzv")

39
lua/sets.lua Normal file
View file

@ -0,0 +1,39 @@
-- line numbers
vim.o.number = true
vim.o.relativenumber = true
-- show hidden characters
vim.opt.list = true
vim.opt.listchars = { tab = '', trail = '·' }
-- indentation
vim.opt.expandtab = true
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.smartindent = true
-- line wrapping
vim.opt.wrap = false
-- undo history
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = os.getenv("HOME") .. "/.local/state/nvim/undodir"
vim.opt.undofile = true
vim.opt.updatetime = 50
-- end search when exiting
vim.opt.hlsearch = false
vim.opt.incsearch = true
-- stuff
vim.opt.fillchars:append({ eob = ' ' })
vim.opt.termguicolors = true
vim.opt.scrolloff = 8
vim.opt.colorcolumn = "80"

4
stylua.toml Normal file
View file

@ -0,0 +1,4 @@
indent_type = "Spaces"
indent_width = 4
column_width = 120
quote_style = "ForceDouble"