mirror of
https://github.com/darwincereska/nvim-config.git
synced 2026-02-12 06:24:42 -05:00
feat(working): first working condition
This commit is contained in:
@@ -13,20 +13,71 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
_G.vim = _G.vim or {}
|
||||
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 = "\\"
|
||||
|
||||
-- Line numbers
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.clipboard = "unnamedplus"
|
||||
vim.opt.signcolumn = "yes"
|
||||
|
||||
-- Tabs and indentation
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
vim.opt.autoindent = true
|
||||
vim.opt.smartindent = true
|
||||
|
||||
-- Line wrapping
|
||||
vim.opt.wrap = false
|
||||
vim.opt.linebreak = true
|
||||
|
||||
-- Search settings
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
vim.opt.hlsearch = true
|
||||
vim.opt.incsearch = true
|
||||
|
||||
-- Appearance
|
||||
vim.opt.termguicolors = true
|
||||
vim.opt.background = "dark"
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.showmode = false
|
||||
|
||||
-- Backspace
|
||||
vim.opt.backspace = "indent,eol,start"
|
||||
|
||||
-- Clipboard
|
||||
vim.opt.clipboard = "unnamedplus"
|
||||
|
||||
-- Split windows
|
||||
vim.opt.splitright = true
|
||||
vim.opt.splitbelow = true
|
||||
|
||||
-- Folding
|
||||
vim.o.foldenable = true
|
||||
vim.opt.foldmethod = "expr"
|
||||
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
vim.opt.foldlevelstart = 99
|
||||
|
||||
-- Better performance
|
||||
vim.opt.updatetime = 250
|
||||
vim.opt.timeoutlen = 300
|
||||
vim.opt.undofile = true
|
||||
|
||||
-- Completion
|
||||
vim.opt.completeopt = "menu,menuone,noselect"
|
||||
|
||||
-- Scrolling
|
||||
vim.opt.scrolloff = 8
|
||||
vim.opt.sidescrolloff = 8
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
require("Comment").setup({
|
||||
-- Add a space b/w comment and the line
|
||||
padding = true,
|
||||
-- Whether the cursor should stay at its position
|
||||
sticky = true,
|
||||
-- Lines to be ignored while (un)comment
|
||||
ignore = nil,
|
||||
-- LHS of toggle mappings in NORMAL mode
|
||||
toggler = {
|
||||
line = 'gcc', -- Line-comment toggle keymap
|
||||
block = 'gbc', -- Block-comment toggle keymap
|
||||
},
|
||||
-- LHS of operator-pending mappings in NORMAL and VISUAL mode
|
||||
opleader = {
|
||||
line = 'gc', -- Line-comment keymap
|
||||
block = 'gb', -- Block-comment keymap
|
||||
},
|
||||
-- LHS of extra mappings
|
||||
extra = {
|
||||
above = 'gcO', -- Add comment on the line above
|
||||
below = 'gco', -- Add comment on the line below
|
||||
eol = 'gcA', -- Add comment at the end of line
|
||||
},
|
||||
-- Enable keybindings
|
||||
mappings = {
|
||||
basic = true, -- Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}`
|
||||
extra = true, -- Extra mapping; `gco`, `gcO`, `gcA`
|
||||
},
|
||||
})
|
||||
@@ -1,27 +0,0 @@
|
||||
require("neo-tree").setup({
|
||||
close_if_last_window = true,
|
||||
hijack_netrw_behavior = "disabled",
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
hide_gitignored = true,
|
||||
hide_hidden = true,
|
||||
},
|
||||
follow_current_file = { enabled = true },
|
||||
},
|
||||
git_status = {
|
||||
enable = true,
|
||||
},
|
||||
window = {
|
||||
position = "left",
|
||||
auto_expand_width = false,
|
||||
hijack_netrw_behavior = "disabled",
|
||||
width = 35,
|
||||
mappings = {
|
||||
["<space>"] = "toggle_node",
|
||||
["<2-LeftMouse>"] = "open",
|
||||
["e"] = function() vim.api.nvim_exec("Neotree focus filesystem", true) end,
|
||||
["g"] = function() vim.api.nvim_exec("Neotree focus git_status", true) end,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
require("oil").setup({
|
||||
default_file_explorer = true,
|
||||
columns = {
|
||||
"icon",
|
||||
},
|
||||
keymaps = {
|
||||
["g."] = { "actions.toggle_hidden", mode = "n"}
|
||||
}
|
||||
|
||||
})
|
||||
@@ -1,73 +0,0 @@
|
||||
require("render-markdown").setup({
|
||||
completions = { lsp = { enabled = true } },
|
||||
|
||||
heading = {
|
||||
enabled = true,
|
||||
sign = false,
|
||||
icons = { " ", " ", " ", " ", " ", " " },
|
||||
signs = { "▶"},
|
||||
left_pad = 0,
|
||||
right_pad = 0,
|
||||
width = "full",
|
||||
min_width = 0,
|
||||
border = true,
|
||||
border_virtual = true,
|
||||
above = "▄",
|
||||
below = "▀",
|
||||
},
|
||||
|
||||
code = {
|
||||
enabled = true,
|
||||
sign = true,
|
||||
style = "full",
|
||||
position = "left",
|
||||
language_pad = 2,
|
||||
disable_background = { "diff" },
|
||||
width = "full",
|
||||
left_pad = 0,
|
||||
right_pad = 0,
|
||||
min_width = 0,
|
||||
border = "thin",
|
||||
above = "▄",
|
||||
below = "▀",
|
||||
highlight = "RenderMarkdownCode",
|
||||
highlight_inline = "RenderMarkdownCodeInline",
|
||||
},
|
||||
|
||||
win_options = {
|
||||
conceallevel = {
|
||||
default = vim.o.conceallevel,
|
||||
rendered = 3,
|
||||
},
|
||||
concealcursor = {
|
||||
default = vim.o.concealcursor,
|
||||
rendered = "n",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Fix tab behavior in markdown files
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "markdown",
|
||||
callback = function()
|
||||
-- Override tab mapping in markdown files
|
||||
vim.keymap.set("i", "<Tab>", function()
|
||||
-- Check if we're in a code block
|
||||
local line = vim.api.nvim_get_current_line()
|
||||
local col = vim.api.nvim_win_get_cursor(0)[2]
|
||||
|
||||
-- If we're at the beginning of a line or after whitespace, insert tab
|
||||
if col == 0 or line:sub(1, col):match("^%s*$") then
|
||||
return "<Tab>"
|
||||
else
|
||||
-- Otherwise, let completion handle it if available
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
return "<C-n>"
|
||||
else
|
||||
return "<Tab>"
|
||||
end
|
||||
end
|
||||
end, { expr = true, buffer = true })
|
||||
end,
|
||||
})
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
require("lualine").setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "auto",
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {
|
||||
statusline = { "NvimTree", "neo-tree", "alpha", "dashboard" },
|
||||
winbar = { "NvimTree", "neo-tree", "alpha", "dashboard" },
|
||||
},
|
||||
ignore_focus = { "NvimTree", "neo-tree" },
|
||||
always_divide_middle = true,
|
||||
globalstatus = true, -- This makes lualine span the entire bottom
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
}
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" }, -- Shows full text like "NORMAL", "INSERT", "VISUAL"
|
||||
lualine_b = { "branch", "diff", "diagnostics" },
|
||||
lualine_c = {
|
||||
"filename",
|
||||
{
|
||||
function()
|
||||
return vim.b.table_mode_active == 1 and "[TABLE]" or ""
|
||||
end,
|
||||
color = { fg = "#98c379" }, -- Green color
|
||||
},
|
||||
},
|
||||
lualine_x = { "encoding", "fileformat", "filetype" },
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" }
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = { "nvim-tree", "neo-tree" }
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
require("telescope").setup({
|
||||
defaults = {
|
||||
file_ignore_patterns = { "node_modules", ".git/" },
|
||||
},
|
||||
})
|
||||
@@ -1,27 +0,0 @@
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"lua",
|
||||
"python",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"html",
|
||||
"css",
|
||||
"json",
|
||||
"yaml",
|
||||
"bash",
|
||||
"vim",
|
||||
"c",
|
||||
"cpp",
|
||||
"lua",
|
||||
"go",
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = { "markdown" },
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
||||
@@ -1,22 +0,0 @@
|
||||
-- Basic fold UI
|
||||
vim.o.foldcolumn = '1'
|
||||
vim.o.foldlevel = 99
|
||||
vim.o.foldlevelstart = 99
|
||||
vim.o.foldenable = true
|
||||
|
||||
-- Triangles for folds
|
||||
vim.opt.fillchars = {
|
||||
foldopen = "▼",
|
||||
foldclose = "▶",
|
||||
foldsep = " ",
|
||||
}
|
||||
|
||||
require("ufo").setup({
|
||||
provider_selector = function(bufnr, filetype, buftype)
|
||||
if filetype == "markdown" then
|
||||
return { "treesitter", "indent" }
|
||||
end
|
||||
return { "lsp", "indent" }
|
||||
end,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user