1
0

first commit

This commit is contained in:
2025-03-30 12:20:24 +01:00
commit 20edc7dc7e
19 changed files with 1007 additions and 0 deletions

View File

@@ -0,0 +1,78 @@
require("config.lazy")
vim.opt.mouse = ''
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.rnu = true
-- length of an actual \t character:
vim.opt.tabstop=2
-- length to use when editing text (eg. TAB and BS keys)
-- (0 for 'tabstop', -1 for 'shiftwidth'):
vim.opt.softtabstop=-1
-- length to use when shifting text (eg. <<, >> and == commands)
-- (0 for 'tabstop'):
vim.opt.shiftwidth=0
-- round indentation to multiples of 'shiftwidth' when shifting text
-- (so that it behaves like Ctrl-D / Ctrl-T):
vim.opt.shiftround = true
-- if set, only insert spaces; otherwise insert \t and complete with spaces:
vim.opt.expandtab = true
-- reproduce the indentation of the previous line:
vim.opt.autoindent = true
-- keep indentation produced by 'autoindent' if leaving the line blank:
-- vim.opt.cpoptions+=I
-- try to be smart (increase the indenting level after '{',
-- decrease it after '}', and so on):
vim.opt.smartindent = true
-- a stricter alternative which works better for the C language:
vim.opt.cindent = true
-- keep cursor <lines> away from the top and bottom of the screen
vim.opt.scrolloff = 6
-- marker at line 80
vim.opt.colorcolumn = "80"
-- use language-specific plugins for indenting (better):
vim.cmd("filetype plugin indent on")
vim.cmd("syntax on")
vim.keymap.set('n', 'p', '<Cmd>pu<CR>')
vim.g.mapleader = " "
vim.keymap.set("n", "<leader>ll", vim.cmd.Ex)
-- Telescope
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.git_files, { desc = 'Telescope find git files' })
vim.keymap.set('n', '<leader>fG', function()
builtin.grep_string({ search = vim.fn.input("grep > ") } );
end )
-- UndoTree
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
vim.opt.undofile = true
-- Reserve a space in the gutter
vim.opt.signcolumn = 'yes'
-- move paragraphs
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
-- cut to system clipboard
vim.keymap.set("n", "<leader>y", "\"+y")
vim.keymap.set("v", "<leader>y", "\"+y")
vim.keymap.set("n", "<leader>Y", "\"+Y")
-- Diagnostics
vim.diagnostic.config({
virtual_text = false,
})
vim.diagnostic.config({ virtual_lines = true })

View File

@@ -0,0 +1,14 @@
{
"blink.cmp": { "branch": "main", "commit": "49f211fe5d729df53df4c042d7c3464cf47d199e" },
"dracula.nvim": { "branch": "main", "commit": "96c9d19ce81b26053055ad6f688277d655b3f7d2" },
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lsp_lines.nvim": { "branch": "main", "commit": "a92c755f182b89ea91bd8a6a2227208026f27b4d" },
"marks.nvim": { "branch": "master", "commit": "bb25ae3f65f504379e3d08c8a02560b76eaf91e8" },
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
"nvim-lspconfig": { "branch": "master", "commit": "0a1ac55d7d4ec2b2ed9616dfc5406791234d1d2b" },
"nvim-treesitter": { "branch": "master", "commit": "aece1062335a9e856636f5da12d8a06c7615ce8a" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"undotree": { "branch": "master", "commit": "b951b87b46c34356d44aa71886aecf9dd7f5788a" }
}

View File

@@ -0,0 +1,35 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- import your plugins
{ import = "plugins" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "habamax" } },
-- automatically check for plugin updates
checker = { enabled = true },
})

View File

@@ -0,0 +1,53 @@
return {
'saghen/blink.cmp',
-- optional: provides snippets for the snippet source
dependencies = { 'rafamadriz/friendly-snippets' },
-- use a release tag to download pre-built binaries
version = '1.*',
-- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
-- build = 'cargo build --release',
-- If you use nix, you can build from source using latest nightly rust with:
-- build = 'nix run .#build-plugin',
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
-- 'super-tab' for mappings similar to vscode (tab to accept)
-- 'enter' for enter to accept
-- 'none' for no mappings
--
-- All presets have the following mappings:
-- C-space: Open menu or open docs if already open
-- C-n/C-p or Up/Down: Select next/previous item
-- C-e: Hide menu
-- C-k: Toggle signature help (if signature.enabled = true)
--
-- See :h blink-cmp-config-keymap for defining your own keymap
keymap = { preset = 'super-tab' },
appearance = {
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
-- Adjusts spacing to ensure icons are aligned
nerd_font_variant = 'mono'
},
-- (Default) Only show the documentation popup when manually triggered
completion = { documentation = { auto_show = true } },
-- Default list of enabled providers defined so that you can extend it
-- elsewhere in your config, without redefining it, due to `opts_extend`
sources = {
default = { 'lsp', 'path', 'snippets', 'buffer' },
},
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
--
-- See the fuzzy documentation for more information
fuzzy = { implementation = "prefer_rust_with_warning" }
},
opts_extend = { "sources.default" }
}

View File

@@ -0,0 +1,10 @@
return {
{
"Mofiqul/dracula.nvim",
lazy = false, -- make sure we load this during startup if it is your main colorscheme
priority = 1000, -- make sure to load this before all the other start plugins
config = function()
vim.cmd([[colorscheme dracula]])
end,
},
}

View File

@@ -0,0 +1,8 @@
return {
{
"https://git.sr.ht/~whynothugo/lsp_lines.nvim",
config = function()
require("lsp_lines").setup()
end,
}
}

View File

@@ -0,0 +1,7 @@
return {
{
"chentoast/marks.nvim",
event = "VeryLazy",
opts = {},
},
}

View File

@@ -0,0 +1,7 @@
return {
{
'williamboman/mason.nvim',
lazy = false,
opts = {},
},
}

View File

@@ -0,0 +1,35 @@
return {
{
'neovim/nvim-lspconfig',
dependencies = { 'saghen/blink.cmp' },
opts = {
servers = {
lua_ls = {
autostart = true,
settings = {
Lua = {
diagnostics = { globals = {'vim'} }
}
},
},
markdown_oxide = {},
terraformls = {},
superhtml = {},
pyright = {},
taplo = {},
bashls = {},
html = {},
}
},
config = function(_, opts)
local lspconfig = require('lspconfig')
for server, config in pairs(opts.servers) do
-- passing config.capabilities to blink.cmp merges with the capabilities in your
-- `opts[server].capabilities, if you've defined it
config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
lspconfig[server].setup(config)
end
end
}
}

View File

@@ -0,0 +1,5 @@
return {
'nvim-telescope/telescope.nvim', tag = '0.1.8',
-- or , branch = '0.1.x',
dependencies = { 'nvim-lua/plenary.nvim' }
}

View File

@@ -0,0 +1,22 @@
local opts = {
ensure_installed = {
'c',
'lua',
'vim',
'vimdoc',
'query',
'markdown',
'markdown_inline',
},
}
local function config()
require('nvim-treesitter.configs').setup(opts)
end
return {
'nvim-treesitter/nvim-treesitter',
config = config,
build = ':TSUpdate'
}

View File

@@ -0,0 +1,5 @@
return {
{
"mbbill/undotree"
}
}