--- /dev/null
+local set = vim.opt_local
+
+set.shiftwidth = 2
+set.number = true
-require("lukas")
+require("config.lazy")
+
+require("config.autocommands")
+require("config.keymap")
+require("config.settings")
--- /dev/null
+{
+ "blink.cmp": { "branch": "main", "commit": "485c03400608cb6534bbf84da8c1c471fc4808c0" },
+ "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
+ "hop.nvim": { "branch": "master", "commit": "08ddca799089ab96a6d1763db0b8adc5320bf050" },
+ "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
+ "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" },
+ "mini.nvim": { "branch": "main", "commit": "5d8d141cb113e9d235c9215475b26b0d20612150" },
+ "nvim-lspconfig": { "branch": "master", "commit": "ac04ec3c2af08e9821b4eb64ede86072b9b213bf" },
+ "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
+ "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
+ "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
+ "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
+ "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }
+}
--- /dev/null
+-- remove trailing whitespace on save
+vim.api.nvim_create_autocmd({ "BufWritePre" }, {
+ pattern = { "*" },
+ command = [[%s/\s\+$//e]],
+})
+
+-- highlight when yanking text
+vim.api.nvim_create_autocmd('TextYankPost', {
+ desc = 'highlight when yanking text',
+ group = vim.api.nvim_create_augroup('highlight-yank', { clear = true }),
+ callback = function()
+ vim.highlight.on_yank()
+ end,
+})
+
+-- integrated terminal stuff
+vim.api.nvim_create_autocmd('TermOpen', {
+ group = vim.api.nvim_create_augroup('custom-term-open', { clear = true }),
+ callback = function()
+ vim.opt.number = false
+ vim.opt.relativenumber = false
+ end,
+})
+vim.keymap.set("n", "<space>st", function()
+ vim.cmd.vnew()
+ vim.cmd.term()
+ vim.cmd.wincmd("J")
+ vim.api.nvim_win_set_height(0, 15)
+end)
+
--- /dev/null
+
+-- shortcut escape in insert mode
+vim.keymap.set('i', 'jj', '<Esc>')
+
+-- move highlighted lines
+vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
+vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
+
+-- execute lua code
+vim.keymap.set("n", "<space><space>x", "<cmd>source % <CR>")
+vim.keymap.set("n", "<space>x", ":.lua<CR>")
+vim.keymap.set("v", "<space>x", ":lua<CR>")
+
+-- quickfix commands
+vim.keymap.set("n", "<M-j>", "<cmd>cnext<CR>")
+vim.keymap.set("n", "<M-k>", "<cmd>cprev<CR>")
+
--- /dev/null
+-- 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
+-- put lazy in the runtimepath for neovim
+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 = {
+ { "folke/tokyonight.nvim", config = function() vim.cmd.colorscheme "tokyonight" end },
+ { import = "config.plugins" },
+ }
+})
+
--- /dev/null
+return {
+ {
+ 'saghen/blink.cmp',
+ dependencies = 'rafamadriz/friendly-snippets',
+
+ version = 'v0.*',
+
+ opts = {
+ keymap = { preset = 'default' },
+
+ appearance = {
+ use_nvim_cmp_as_default = true,
+ nerd_font_variant = 'mono'
+ },
+
+ signature = { enabled = true }
+ },
+ },
+}
--- /dev/null
+return {
+ 'smoka7/hop.nvim',
+ version = "*",
+ opts = {
+ keys = 'etovxqpdygfblzhckisuran'
+ },
+ config = function()
+ local hop = require('hop')
+ local directions = require('hop.hint').HintDirection
+
+ hop.setup()
+
+ vim.keymap.set('n', '<space>j', function()
+ hop.hint_lines({ direction = directions.AFTER_CURSOR })
+ end, {remap=true})
+
+ vim.keymap.set('n', '<space>k', function()
+ hop.hint_lines({ direction = directions.BEFORE_CURSOR })
+ end, {remap=true})
+
+ vim.keymap.set('n', 'f', function()
+ hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true })
+ end, {remap=true})
+
+ vim.keymap.set('n', 'F', function()
+ hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true })
+ end, {remap=true})
+ end
+}
+
--- /dev/null
+return {
+ {
+ "neovim/nvim-lspconfig",
+
+ dependencies = {
+ "folke/lazydev.nvim",
+ ft = "lua", -- only load on lua files
+ opts = {
+ library = {
+ -- load luvit types when the `vim.uv` word is found
+ { path = "${3rd}/luv/library", words = { "vim%.uv" } },
+ }
+ },
+ },
+
+ config = function()
+ -- Use LspAttach autocommand to only map the following keys
+ -- after the language server attaches to the current buffer
+ vim.api.nvim_create_autocmd("LspAttach", {
+ callback = function(args)
+ local bufnr = args.buf
+ local client = assert(vim.lsp.get_client_by_id(args.data.client_id), "must have valid client")
+
+ local builtin = require "telescope.builtin"
+
+ -- Enable completion triggered by <c-x><c-o>
+ vim.opt_local.omnifunc = "v:lua.vim.lsp.omnifunc"
+ vim.keymap.set("n", "gd", vim.lsp.buf.definition, { buffer = 0 })
+ vim.keymap.set("n", "gr", builtin.lsp_references, { buffer = 0 })
+ vim.keymap.set("n", "gf", vim.lsp.buf.declaration, { buffer = 0 })
+ -- vim.keymap.set("n", "gT", vim.lsp.buf.type_definition, { buffer = 0 })
+ vim.keymap.set("n", "gh", vim.lsp.buf.hover, { buffer = 0 })
+
+ vim.keymap.set("n", "<space>cr", vim.lsp.buf.rename, { buffer = 0 })
+ -- vim.keymap.set("n", "<space>ca", vim.lsp.buf.code_action, { buffer = 0 })
+ vim.keymap.set("n", "<space>wd", builtin.lsp_document_symbols, { buffer = 0 })
+ vim.keymap.set("n", "<space>ww", function()
+ builtin.diagnostics { root_dir = true }
+ end, { buffer = 0 })
+ end
+ })
+
+ local capabilities = require('blink.cmp').get_lsp_capabilities()
+ require("lspconfig").lua_ls.setup { capabilities = capabilities }
+ require("lspconfig").clangd.setup { capabilities = capabilities }
+ end,
+ }
+}
--- /dev/null
+return {
+ {
+ 'echasnovski/mini.nvim',
+ enabled = true,
+ config = function()
+ local statusline = require 'mini.statusline'
+ statusline.setup { use_icons = true }
+ end
+ }
+}
+
--- /dev/null
+return {
+ 'nvim-telescope/telescope.nvim',
+ tag = '0.1.8',
+ dependencies = {
+ 'nvim-lua/plenary.nvim',
+ { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }
+ },
+ config = function()
+ require('telescope').setup {
+ pickers = {
+ find_files = {
+ theme = "ivy"
+ }
+ },
+ extensions = {
+ fzf = {}
+ }
+ }
+
+ require('telescope').load_extension('fzf')
+
+ vim.keymap.set("n", "<space>fh", require('telescope.builtin').help_tags)
+ vim.keymap.set("n", "<space>fp", require('telescope.builtin').find_files)
+ vim.keymap.set("n", "<space>fc", function()
+ require('telescope.builtin').find_files {
+ cwd = vim.fn.stdpath("config")
+ }
+ end)
+
+ vim.keymap.set("n", "<space>fl", function()
+ require('telescope.builtin').find_files {
+ cwd = vim.fn.stdpath("data") .. "/lazy"
+ }
+ end)
+
+ require('config.telescope.multigrep').setup()
+
+ end
+}
+
--- /dev/null
+return {
+ {
+ "nvim-treesitter/nvim-treesitter",
+ branch = 'master',
+ lazy = false,
+ build = ":TSUpdate",
+ config = function()
+ require'nvim-treesitter.configs'.setup {
+ -- A list of parser names, or "all" (the listed parsers MUST always be installed)
+ ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline" },
+ auto_install = false,
+ ignore_install = { "javascript" },
+ highlight = {
+ enable = true,
+ -- disable slow treesitter highlight for large files
+ disable = function(lang, buf)
+ local max_filesize = 100 * 1024 -- 100 KB
+ local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
+ if ok and stats and stats.size > max_filesize then
+ return true
+ end
+ end,
+ additional_vim_regex_highlighting = false,
+ },
+ }
+ end
+ }
+}
+
--- /dev/null
+vim.opt.clipboard = "unnamedplus"
+
+vim.opt.tabstop = 4
+vim.opt.softtabstop = 4
+vim.opt.shiftwidth = 4
+vim.opt.expandtab = true
+
+vim.opt.smartindent = true
+
+vim.opt.wrap = false
+
+vim.opt.swapfile = false
+vim.opt.backup = false
+
+vim.opt.undofile = true
+
+vim.opt.hlsearch = false
+vim.opt.incsearch = true
+vim.opt.ignorecase = true
+vim.opt.smartcase = true
+
+-- vim.opt.termguicolors = false
+
+vim.opt.scrolloff = 8
+vim.opt.signcolumn = "yes"
+vim.opt.isfname:append("@-@")
+
+vim.opt.updatetime = 50
+
+-- vim.opt.colorcolumn = "80"
--- /dev/null
+local pickers = require("telescope.pickers")
+local finders = require("telescope.finders")
+local make_entry = require("telescope.make_entry")
+local conf = require("telescope.config").values
+
+local M = {}
+
+local live_multigrep = function(opts)
+ opts = opts or {}
+ opts.cwd = opts.cwd or vim.uv.cwd()
+
+ local finder = finders.new_async_job {
+ command_generator = function(prompt)
+ if not prompt or prompt == "" then
+ return nil
+ end
+
+ local pieces = vim.split(prompt, " ")
+ local args = { "rg" }
+
+ if pieces[1] then
+ table.insert(args, "-e")
+ table.insert(args, pieces[1])
+ end
+
+ if pieces[2] then
+ table.insert(args, "-g")
+ table.insert(args, pieces[2])
+ end
+
+ return vim.tbl_flatten {
+ args,
+ { "--color=never", "--no-heading", "--with-filename", "--line-number", "--column", "--smart-case" },
+ }
+ end,
+ entry_maker = make_entry.gen_from_vimgrep(opts),
+ cwd = opts.cwd,
+ }
+
+ pickers.new(opts, {
+ debounce = 100,
+ pompt_title = "multigrep",
+ finder = finder,
+ previewer = conf.grep_previewer(opts),
+ sorder = require("telescope.sorters").empty()
+ }):find()
+end
+
+M.setup = function()
+ vim.keymap.set("n", "<leader>fg", live_multigrep)
+end
+
+return M
--- /dev/null
+vim.keymap.set("t", "<esc><esc>", "<c-\\><c-n>")
+
+local state = {
+ floating = {
+ buf = -1,
+ win = -1,
+ }
+}
+
+local function create_floating_window(opts)
+ opts = opts or {}
+ local width = opts.width or math.floor(vim.o.columns * 0.8)
+ local height = opts.height or math.floor(vim.o.lines * 0.8)
+
+ -- Calculate the position to center the window
+ local col = math.floor((vim.o.columns - width) / 2)
+ local row = math.floor((vim.o.lines - height) / 2)
+
+ -- Create a buffer
+ local buf = nil
+ if vim.api.nvim_buf_is_valid(opts.buf) then
+ buf = opts.buf
+ else
+ buf = vim.api.nvim_create_buf(false, true) -- No file, scratch buffer
+ end
+
+ -- Define window configuration
+ local win_config = {
+ relative = "editor",
+ width = width,
+ height = height,
+ col = col,
+ row = row,
+ style = "minimal", -- No borders or extra UI elements
+ border = "rounded",
+ }
+
+ -- Create the floating window
+ local win = vim.api.nvim_open_win(buf, true, win_config)
+
+ return { buf = buf, win = win }
+end
+
+local toggle_terminal = function()
+ if not vim.api.nvim_win_is_valid(state.floating.win) then
+ state.floating = create_floating_window { buf = state.floating.buf }
+ if vim.bo[state.floating.buf].buftype ~= "terminal" then
+ vim.cmd.terminal()
+ end
+ else
+ vim.api.nvim_win_hide(state.floating.win)
+ end
+end
+
+-- Example usage:
+-- Create a floating window with default dimensions
+vim.api.nvim_create_user_command("Floaterminal", toggle_terminal, {})
+vim.keymap.set({ "n", "t" }, "<space>tt", toggle_terminal)