This commit is contained in:
Nathan Lebrun
2025-07-11 18:36:55 +02:00
parent 91836e8063
commit 6fc940320c
1511 changed files with 674 additions and 102348 deletions

24
nvim/LICENSE Normal file
View File

@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org>

1
nvim/README.md Normal file
View File

@@ -0,0 +1 @@
# my config for NVIM

56
nvim/init.lua Normal file
View File

@@ -0,0 +1,56 @@
vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/"
vim.g.mapleader = " "
-- bootstrap lazy and all plugins
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
local repo = "https://github.com/folke/lazy.nvim.git"
vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }
end
vim.opt.rtp:prepend(lazypath)
local lazy_config = require "configs.lazy"
-- load plugins
require("lazy").setup({
{
"NvChad/NvChad",
lazy = false,
branch = "v2.5",
import = "nvchad.plugins",
},
{ import = "plugins" },
}, lazy_config)
-- load theme
dofile(vim.g.base46_cache .. "defaults")
dofile(vim.g.base46_cache .. "statusline")
require "options"
require "nvchad.autocmds"
require "custom.function_lines"
local cpp_gen = require("custom.cpp_gen")
vim.api.nvim_create_user_command("GenCPPFile", function(opts)
cpp_gen.generate_cpp_file(opts.args)
end, {nargs = "?"})
local hpp_gen = require("custom.hpp_gen")
vim.api.nvim_create_user_command("GenHPPFile", function(opts)
hpp_gen.generate_hpp_file(opts.args)
end, {nargs = 1})
vim.schedule(function()
require "mappings"
end)
-- auto added code by nalebrun header42
local header = require('header')
vim.api.nvim_create_user_command(
'Header',
function()
header.insert_header()
end,
{}
)

31
nvim/lazy-lock.json Normal file
View File

@@ -0,0 +1,31 @@
{
"LuaSnip": { "branch": "master", "commit": "faf3c94a44508cec1b961406d36cc65113ff3b98" },
"NvChad": { "branch": "v2.5", "commit": "6f25b2739684389ca69ea8229386c098c566c408" },
"base46": { "branch": "v3.0", "commit": "80358ecdb5779b199130ed03031c34c0c2bca3fc" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"conform.nvim": { "branch": "master", "commit": "a6f5bdb78caa305496357d17e962bbc4c0b392e2" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"fzf-lua": { "branch": "main", "commit": "e6afa1aa22893280720cde1cdd0b0b188d5815af" },
"gitsigns.nvim": { "branch": "main", "commit": "8b729e489f1475615dc6c9737da917b3bc163605" },
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"mason.nvim": { "branch": "main", "commit": "9eaedb864cdadc29c6eb7d761a6c0d8aee26c91b" },
"menu": { "branch": "main", "commit": "8adb036ec34c679050913864cbc98cc64eb91f6c" },
"minty": { "branch": "main", "commit": "aafc9e8e0afe6bf57580858a2849578d8d8db9e0" },
"nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-lspconfig": { "branch": "master", "commit": "1110787f1b464888c59a044c48c5119d14078044" },
"nvim-tree.lua": { "branch": "master", "commit": "25d16aab7d29ca940a9feb92e6bb734697417009" },
"nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" },
"nvim-web-devicons": { "branch": "master", "commit": "1020869742ecb191f260818234517f4a1515cfe8" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
"ui": { "branch": "v3.0", "commit": "9a60cd12635c7235200d810bf94019c0c931a656" },
"volt": { "branch": "main", "commit": "c45d5f48da8e802e608b5c6da471ca4d84276dfb" },
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
}

17
nvim/lua/chadrc.lua Normal file
View File

@@ -0,0 +1,17 @@
-- This file needs to have same structure as nvconfig.lua
-- https://github.com/NvChad/ui/blob/v3.0/lua/nvconfig.lua
-- Please read that file to know all available options :(
---@type ChadrcConfig
local M = {}
M.base46 = {
theme = "github_dark",
-- hl_override = {
-- Comment = { italic = true },
-- ["@comment"] = { italic = true },
-- },
}
return M

View File

@@ -0,0 +1,15 @@
local options = {
formatters_by_ft = {
lua = { "stylua" },
-- css = { "prettier" },
-- html = { "prettier" },
},
-- format_on_save = {
-- -- These options will be passed to conform.format()
-- timeout_ms = 500,
-- lsp_fallback = true,
-- },
}
return options

47
nvim/lua/configs/lazy.lua Normal file
View File

@@ -0,0 +1,47 @@
return {
defaults = { lazy = true },
install = { colorscheme = { "nvchad" } },
ui = {
icons = {
ft = "",
lazy = "󰂠 ",
loaded = "",
not_loaded = "",
},
},
performance = {
rtp = {
disabled_plugins = {
"2html_plugin",
"tohtml",
"getscript",
"getscriptPlugin",
"gzip",
"logipat",
"netrw",
"netrwPlugin",
"netrwSettings",
"netrwFileHandlers",
"matchit",
"tar",
"tarPlugin",
"rrhelper",
"spellfile_plugin",
"vimball",
"vimballPlugin",
"zip",
"zipPlugin",
"tutor",
"rplugin",
"syntax",
"synmenu",
"optwin",
"compiler",
"bugreport",
"ftplugin",
},
},
},
}

View File

@@ -0,0 +1,20 @@
-- load defaults i.e lua_lsp
require("nvchad.configs.lspconfig").defaults()
local lspconfig = require "lspconfig"
local on_attach = require("nvchad.configs.lspconfig").on_attach
local capabilities = require("nvchad.configs.lspconfig").capabilities
lspconfig.clangd.setup{
on_attach = on_attach,
capabilities = capabilities,
}
-- configuring single server, example: typescript
-- lspconfig.ts_ls.setup {
-- on_attach = nvlsp.on_attach,
-- on_init = nvlsp.on_init,
-- capabilities = nvlsp.capabilities,
-- }

View File

@@ -0,0 +1,13 @@
M.nvimtree = {
git = {
enable = false,
},
renderer = {
highlight_git = false,
icons = {
show = {
git = false,
},
},
},
}

145
nvim/lua/custom/cpp_gen.lua Normal file
View File

@@ -0,0 +1,145 @@
local M = {}
-- Helper function to trim whitespace.
local function trim(s)
return (s:gsub("^%s*(.-)%s*$", "%1"))
end
-- Main function:
-- filename: The header file name, e.g. "MyClass.hpp"
function M.generate_cpp_file(header_file)
-- Read the header file contents.
if header_file == nil or header_file == "" then
header_file = vim.api.nvim_buf_get_name(0)
end
local file = io.open(header_file, "r")
if not file then
print("Error: could not open file " .. header_file)
return
end
local content = file:read("*a")
file:close()
-- Extract the class name.
-- In this example, we assume the header file name is the same as the class name.
local class_name = header_file:match("([^/\\]+)%.hpp$")
if not class_name then
print("Error: could not determine class name from header file name.")
return
end
-- Prepare a table to store function definitions.
local functions = {}
-- A very simple parser: we assume each function is declared on a single line.
-- Look for setters (e.g., void setSomething(...);)
for line in content:gmatch("[^\r\n]+") do
line = trim(line)
-- Match setters: assume declaration is like "void setX(type x);" (ignoring qualifiers).
local set_func, args = line:match("void%s+(set%u%w*)%s*%(([^)]*)%)")
if set_func then
table.insert(functions, {name = set_func, args = trim(args), return_type = "void"})
end
-- Match getters: assume declaration is like "type getX(void) const;" or similar.
-- We capture the return type, function name and arguments.
local ret_type, get_func, args = line:match("([%w_:<>]+)%s+(get%u%w*)%s*%(([^)]*)%)")
if ret_type and get_func then
table.insert(functions, {name = get_func, args = trim(args), return_type = ret_type})
end
end
-- Start building the content for the .cpp file.
local cpp_lines = {}
table.insert(cpp_lines, '#include "' .. class_name .. '.hpp"')
table.insert(cpp_lines, "") -- blank line
table.insert(cpp_lines, "// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓")
table.insert(cpp_lines, "// ┃ CONSTRUCTOR ┃")
table.insert(cpp_lines, "// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛")
table.insert(cpp_lines, "")
-- Default constructor.
table.insert(cpp_lines, class_name .. "::" .. class_name .. "() {")
table.insert(cpp_lines, "}")
table.insert(cpp_lines, "")
-- Copy constructor.
table.insert(cpp_lines, class_name .. "::" .. class_name .. "(const " .. class_name .. " &other) { *this = other; }")
table.insert(cpp_lines, "")
-- Assignment operator.
table.insert(cpp_lines, class_name .. " &" .. class_name .. "::operator=(const " .. class_name .. " &other) {")
table.insert(cpp_lines, " if (this == &other) { return *this; }")
table.insert(cpp_lines, "")
table.insert(cpp_lines, " // copy")
table.insert(cpp_lines, " return *this;")
table.insert(cpp_lines, "}")
table.insert(cpp_lines, "")
-- Destructor.
table.insert(cpp_lines, "// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓")
table.insert(cpp_lines, "// ┃ DESTRUCTOR ┃")
table.insert(cpp_lines, "// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛")
table.insert(cpp_lines, "")
table.insert(cpp_lines, class_name .. "::~" .. class_name .. "() {")
table.insert(cpp_lines, "}")
table.insert(cpp_lines, "")
-- Generate stubs for other member functions (e.g., set and get functions).
if #functions > 0 then
table.insert(cpp_lines, "// ┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓")
table.insert(cpp_lines, "// ┃ GET() ┃ SET() ┃")
table.insert(cpp_lines, "// ┗━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━┛")
table.insert(cpp_lines, "")
for _, func in ipairs(functions) do
-- If no arguments, we insert void explicitly.
local args = func.args
if args == "" then
args = "void"
end
local line = func.return_type .. " " .. class_name .. "::" .. func.name .. "(" .. args .. ")"
-- For getters, you might want to mark the function as const.
if func.name:sub(1, 3) == "get" then
line = line .. " const"
end
table.insert(cpp_lines, line .. " {")
if func.name:sub(1, 3) == "get" then
local string = ""
table.insert(cpp_lines, " return this->" .. string.lower(func.name:sub(4, 4)) .. func.name:sub(5, func.name.len(func.name)) .. ";")
end
if func.name:sub(1, 3) == "set" then
local string = ""
table.insert(cpp_lines, " this->" .. string.lower(func.name:sub(4, 4)) .. func.name:sub(5, func.name.len(func.name)) .. " = " .. func.args:gsub('.*% ', '') .. ";")
end
table.insert(cpp_lines, "}")
table.insert(cpp_lines, "")
end
table.insert(cpp_lines, "// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓")
table.insert(cpp_lines, "// ┃ MEMBER ┃")
table.insert(cpp_lines, "// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛")
table.insert(cpp_lines, "")
else
table.insert(cpp_lines, "// ┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓")
table.insert(cpp_lines, "// ┃ GET() ┃ SET() ┃")
table.insert(cpp_lines, "// ┗━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━┛")
table.insert(cpp_lines, "")
table.insert(cpp_lines, "// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓")
table.insert(cpp_lines, "// ┃ MEMBER ┃")
table.insert(cpp_lines, "// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛")
table.insert(cpp_lines, "")
end
-- Write the generated content to the .cpp file.
local cpp_file = class_name .. ".cpp"
local dir = header_file:match("^(.*[/\\])") or ""
local out = io.open(dir .. cpp_file, "w")
if not out then
print("Error: could not write to file " .. cpp_file)
return
end
out:write(table.concat(cpp_lines, "\n"))
out:close()
print("Generated " .. cpp_file)
end
return M

View File

@@ -0,0 +1,93 @@
local function show_function_lines()
local bufnr = vim.api.nvim_get_current_buf()
local ft = vim.bo[bufnr].filetype
local lang = vim.treesitter.language.get_lang(ft) or ft
local parser = vim.treesitter.get_parser(bufnr, lang)
if not parser then
return
end
local ns = vim.api.nvim_create_namespace('function_lines')
vim.api.nvim_buf_clear_namespace(bufnr, ns, 0, -1)
-- Tree-sitter query for C functions, with three cases:
-- Case 1: Regular function (no pointer)
-- Case 2: Function returning a pointer (one pointer_declarator)
-- Case 3: Function returning a double pointer (two pointer_declarator nodes)
local query = vim.treesitter.query.parse(lang, [[
; Case 1: Regular function (no pointer)
(function_definition
declarator: (function_declarator
declarator: (identifier) @func_name
)
body: (compound_statement) @func_body
) @func;
; Case 2: Function returning a pointer (one pointer_declarator)
(function_definition
declarator: (pointer_declarator
declarator: (function_declarator
declarator: (identifier) @func_name
)
)
body: (compound_statement) @func_body
) @func;
; Case 3: Function returning a double pointer (two pointer_declarator nodes)
(function_definition
declarator: (pointer_declarator
declarator: (pointer_declarator
declarator: (function_declarator
declarator: (identifier) @func_name
)
)
)
body: (compound_statement) @func_body
) @func
]])
for _, tree in ipairs(parser:parse()) do
local root = tree:root()
-- Iterate over each capture from the query
for id, node, _ in query:iter_captures(root, bufnr, 0, -1) do
if query.captures[id] == "func_body" then
-- Get the range of the compound statement.
-- The range includes the braces, so we subtract 2 to get the interior.
local start_line, _, end_line, _ = node:range()
local total_lines = end_line - start_line - 1
if total_lines < 0 then
total_lines = 0
end
-- Get the lines between the braces.
local lines = vim.api.nvim_buf_get_lines(bufnr, start_line + 1, end_line, false)
local comment_lines = 0
for _, line in ipairs(lines) do
-- Adjust this pattern as needed for your comment style.
if line:match("^%s*//") then
comment_lines = comment_lines + 1
end
end
local non_comment_lines = total_lines - comment_lines
-- Prepare the virtual text.
local virt_text = nil
if comment_lines > 0 then
-- If there are comment lines, display two numbers:
-- Total lines / non-comment lines.
virt_text = {{ ' 󰆧 ' .. total_lines .. ' / ' .. non_comment_lines, 'Comment' }}
else
-- If no comments, display only the total line count.
virt_text = {{ ' 󰆧 ' .. total_lines, 'Comment' }}
end
-- Place the virtual text on the closing brace line.
vim.api.nvim_buf_set_extmark(bufnr, ns, end_line, -1, {
virt_text = virt_text,
virt_text_pos = 'eol',
})
end
end
end
end
-- Auto-command to run the function for C files on buffer enter or after writing.
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost' }, {
pattern = '*.c',
callback = show_function_lines,
})-- Auto-command to run the function for C files on buffer enter or after writing.
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost' }, {
pattern = '*.c',
callback = show_function_lines,
})

View File

@@ -0,0 +1,42 @@
local M = {}
function M.generate_hpp_file(class_name)
local class = class_name
local hpp_lines = {}
table.insert(hpp_lines, "#ifndef " .. class.upper(class) .. "_HPP")
table.insert(hpp_lines, "# define " .. class.upper(class) .. "_HPP")
table.insert(hpp_lines, "")
table.insert(hpp_lines, "class " .. class .. " {")
table.insert(hpp_lines, " protected:")
table.insert(hpp_lines, "")
table.insert(hpp_lines, " private:")
table.insert(hpp_lines, "")
table.insert(hpp_lines, " public:")
table.insert(hpp_lines, " " .. cCass .. "();")
table.insert(hpp_lines, "")
table.insert(hpp_lines, " ~" .. class .. "();")
table.insert(hpp_lines, "")
table.insert(hpp_lines, " " .. class .. "(const " .. class .. " &other);")
table.insert(hpp_lines, " " .. class .. " &operator=(const " .. class .. " &other);")
table.insert(hpp_lines, "")
table.insert(hpp_lines, "};")
table.insert(hpp_lines, " // Member")
table.insert(hpp_lines, "")
table.insert(hpp_lines, "#endif")
local hpp_file = class .. ".hpp"
local out = io.open(hpp_file, "w")
if not out then
print("Error: Could not create hpp file")
return
end
out:write(table.concat(hpp_lines, "\n"))
out:close()
print("Generated " .. hpp_file)
end
return M

82
nvim/lua/header.lua Normal file
View File

@@ -0,0 +1,82 @@
local M = {}
local HEADER_LINE_LENGTH = 80
local function pad_text(content, total_length)
local padding = total_length - #content
if padding > 0 then
return content .. string.rep(" ", padding)
else
return content:sub(1, total_length)
end
end
local function get_comment_style()
local filetype = vim.bo.filetype
if filetype == "c" or filetype == "cpp" then
return { block_start = "/*", block_end = "*/", line = " * " }
elseif filetype == "bash" or filetype == "sh" or filetype == "python" then
return { block_start = "#", block_end = "#", line = "#" }
else
return { block_start = "/*", block_end = "*/", line = " * " }
end
end
function M.insert_header()
local filename = vim.fn.expand('%:t') or ""
local author = "nalebrun" -- Replace with your name
local email = "<nalebrun@student.s19.be>" -- Replace with your email
local updated_date = os.date('%Y/%m/%d %H:%M:%S')
local created_date = updated_date
-- Check if header already exists and extract Created and By lines
local existing_created_date, existing_author = nil, nil
for i = 1, vim.fn.line('$') do
local line = vim.fn.getline(i)
if line:find("Created:") then
existing_created_date = line:match("Created: (%d+/%d+/%d+ %d+:%d+:%d+)")
existing_author = line:match("by ([^ ]+)$")
end
if line:find("By:") then
existing_author = line:match("By: ([^ ]+) ")
end
if existing_created_date and existing_author then break end
end
-- Use existing values if found, otherwise use defaults
created_date = existing_created_date or created_date
author = existing_author or author
local comment = get_comment_style()
-- Construct the header lines
local header = {}
table.insert(header, comment.block_start .. " ************************************************************************** " .. comment.block_end)
table.insert(header, comment.block_start .. " " .. comment.block_end)
table.insert(header, comment.block_start .. " ::: :::::::: " .. comment.block_end)
table.insert(header, string.format(comment.block_start .. " %-51s:+: :+: :+: " .. comment.block_end, filename))
table.insert(header, comment.block_start .. " +:+ +:+ +:+ " .. comment.block_end)
table.insert(header, string.format(comment.block_start .. " By: %s %-33s+#+ +:+ +#+ " .. comment.block_end, author, email))
table.insert(header, comment.block_start .. " +#+#+#+#+#+ +#+ " .. comment.block_end)
table.insert(header, string.format(comment.block_start .. " Created: %-20sby %-18s#+# #+# " .. comment.block_end, created_date, author))
table.insert(header, string.format(comment.block_start .. " Updated: %-20sby %-17s### ########.fr " .. comment.block_end, updated_date, author))
table.insert(header, comment.block_start .. " " .. comment.block_end)
table.insert(header, comment.block_start .. " ************************************************************************** " .. comment.block_end)
-- Check for an existing header and replace it; otherwise insert at the top
local first_line_of_header_found = false
for i = 1, vim.fn.line('$') do
local line = vim.fn.getline(i)
if line:find("By:") then
first_line_of_header_found = true
vim.api.nvim_buf_set_lines(0, 0, #header, false, header) -- Replace the header block
break
end
end
if not first_line_of_header_found then
vim.api.nvim_buf_set_lines(0, 0, 0, false, header) -- Insert new header at the top if none exists
end
end
return M

15
nvim/lua/mappings.lua Normal file
View File

@@ -0,0 +1,15 @@
require "nvchad.mappings"
-- add yours here
local map = vim.keymap.set
local mp = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }
map("n", ";", ":", { desc = "CMD enter command mode" })
map("i", "jk", "<ESC>")
mp("n", "<leader>pf", "<cmd>FzfLua files winopts.treesitter=true<cr>", opts)
mp("n", "<leader>pg", "<cmd>FzfLua live_grep<cr>", opts) -- Live grep
mp("n", "<leader>pb", "<cmd>FzfLua buffers<cr>", opts) -- Open buffers
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")

21
nvim/lua/options.lua Normal file
View File

@@ -0,0 +1,21 @@
require "nvchad.options"
-- add yours here!
local o = vim.o
local opt = vim.opt
o.cursorlineopt ='both'
o.expandtab = false
o.smartindent = true
o.smarttab = true
o.tabstop = 4
o.shiftwidth = 4
o.softtabstop = 0
o.relativenumber = true
o.ignorecase = true
o.smartcase = true
o.mouse = "a"
opt.fillchars = { eob = " " }
opt.whichwrap:append "<>[]hl"

52
nvim/lua/plugins/init.lua Normal file
View File

@@ -0,0 +1,52 @@
return {
{
"ibhagwan/fzf-lua",
lazy = false,
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("fzf-lua").setup({
fzf_colors = true,
grep = {
cmd = "grep",
grep_opts = "-n -r --color=always --ignore-case --exclude-dir=.git --exclude-dir=.objs",
silent = true,
},
files = {
prompt = "Files ",
},
})
end,
},
{
"stevearc/conform.nvim",
-- event = 'BufWritePre', -- uncomment for format on save
opts = require "configs.conform",
},
-- These are some examples, uncomment them if you want to see them work!
{
"neovim/nvim-lspconfig",
config = function()
require "configs.lspconfig"
end,
},
-- markdown viewer install with yarn or npm
{
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
build = "cd app && yarn install",
init = function()
vim.g.mkdp_filetypes = { "markdown" }
end,
ft = { "markdown" },
},
-- {
-- "nvim-treesitter/nvim-treesitter",
-- opts = {
-- ensure_installed = {
-- "vim", "lua", "vimdoc",
-- "html", "css"
-- },
-- },
-- },
}