This commit is contained in:
cln
2026-07-05 13:54:24 +00:00
commit e3054f843f
13 changed files with 331 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
-- Keybinds
vim.g.mapleader = " "
-- Source
vim.keymap.set("n", "<leader><leader>", vim.cmd.so)
-- Navigation
vim.keymap.set("n", "<leader>q", "<C-w>l")
+30
View File
@@ -0,0 +1,30 @@
-- vim.options by default
local set = vim.opt
-- indentation related
set.shiftwidth = 4
set.tabstop = 4
set.autoindent = true
set.expandtab = true
-- line numbers
set.number = true
-- appearance
set.ignorecase = true
set.smartcase = true
set.cursorline = true
set.updatetime = 50
-- searching
set.ignorecase = true
set.smartcase = true
set.incsearch = true
-- clipboard
set.clipboard:append("unnamedplus")
-- undo dir
set.swapfile = false
set.backup = false
set.undofile = true
View File
+3
View File
@@ -0,0 +1,3 @@
vim.pack.add { { src = "https://github.com/catppuccin/nvim", name = "catppuccin" } }
vim.cmd.colorscheme "catppuccin-mocha"
-- vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
+87
View File
@@ -0,0 +1,87 @@
vim.pack.add({
'https://github.com/neovim/nvim-lspconfig',
-- Autocompletion
'https://github.com/hrsh7th/cmp-nvim-lsp',
'https://github.com/hrsh7th/cmp-buffer',
'https://github.com/hrsh7th/cmp-path',
'https://github.com/hrsh7th/cmp-cmdline',
'https://github.com/hrsh7th/nvim-cmp',
-- Snippets
'https://github.com/hrsh7th/cmp-vsnip',
'https://github.com/hrsh7th/vim-vsnip',
'https://github.com/L3MON4D3/LuaSnip',
'https://github.com/saadparwaizl/cmp_luasnip',
-- github
'https://github.com/petertriho/cmp-git'
})
-- Set up nvim-cmp.
local cmp = require 'cmp'
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' }, -- For luasnip users.
}, {
{ name = 'buffer' },
})
})
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'git' },
}, {
{ name = 'buffer' },
})
})
require("cmp_git").setup()
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
}),
matching = { disallow_symbol_nonprefix_matching = false }
})
-- Set up lspconfig.
local capabilities = require('cmp_nvim_lsp').default_capabilities()
vim.lsp.config('lua_ls', {
capabilities = capabilities
})
vim.lsp.config('nixd', {
cmd = { "nixd" },
filetypes = { "nix" },
capabilities = capabilities
})
vim.lsp.enable({ "lua_ls", "nixd" })
+10
View File
@@ -0,0 +1,10 @@
vim.pack.add({
'https://github.com/nvim-tree/nvim-web-devicons',
'https://github.com/nvim-lualine/lualine.nvim'
})
require('lualine').setup {
options = {
theme = 'catppuccin-mocha',
icons_enabled = true
}
}
+36
View File
@@ -0,0 +1,36 @@
vim.pack.add({
{ src = 'https://github.com/nvim-tree/nvim-web-devicons' }, -- optional
{ src = 'https://github.com/nvim-tree/nvim-tree.lua' },
})
-- disable netrw at the very start of your init.lua
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- optionally enable 24-bit colour
vim.opt.termguicolors = true
-- empty setup using defaults
require("nvim-tree").setup()
-- OR setup with a config
---@type nvim_tree.config
local config = {
sort = {
sorter = "case_sensitive",
},
view = {
width = 30,
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
},
}
require("nvim-tree").setup(config)
vim.keymap.set("n", "<leader>e", vim.cmd.NvimTreeFocus)
vim.keymap.set("n", "<leader>q", vim.cmd.NvimTreeCollapse)
+9
View File
@@ -0,0 +1,9 @@
vim.pack.add ({
'https://github.com/ojroques/vim-oscyank', -- Shared ssh clipboard
'https://github.com/tpope/vim-fugitive', -- Git plugin
'https://github.com/brenoprata10/nvim-highlight-colors' -- Shows CSS colors when editing files
})
-- CSS colors
vim.opt.termguicolors = true
require('nvim-highlight-colors').setup({})
+11
View File
@@ -0,0 +1,11 @@
vim.pack.add({
'https://github.com/nvim-telescope/telescope.nvim',
'https://github.com/nvim-lua/plenary.nvim',
'https://github.com/nvim-telescope/telescope-fzf-native.nvim',
'https://github.com/nvim-tree/nvim-web-devicons'
})
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live grep' })
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })
+19
View File
@@ -0,0 +1,19 @@
vim.pack.add ({
'https://github.com/nvim-treesitter/nvim-treesitter'
})
require('nvim-treesitter').setup {
-- Directory to install parsers and queries to (prepended to `runtimepath` to have priority)
install_dir = vim.fn.stdpath('data') .. '/site'
}
-- Required parsers and queries
require('nvim-treesitter').install { 'lua', 'nix', 'javascript', 'html', 'css', 'c', 'cpp', 'python', 'kdl', 'markdown' }
-- Syntax highlighting
vim.api.nvim_create_autocmd('FileType', {
pattern = { 'lua', 'nix', 'javascript', 'html', 'css', 'c', 'cpp', 'python', 'kdl', 'markdown' },
callback = function() vim.treesitter.start() end,
})
-- Auto indentation
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"