feat: add new dotfiles

This commit is contained in:
Ahmet Kaan Gümüş 2025-02-22 23:29:01 +03:00
parent 7a5975bb81
commit e8bfb35161
34 changed files with 1474 additions and 0 deletions

View file

@ -0,0 +1,31 @@
-- 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 = "plugins" },
},
-- automatically check for plugin updates
checker = { enabled = true, notify = false },
})

View file

@ -0,0 +1,35 @@
local format_and_save = function()
vim.lsp.buf.format()
vim.cmd.update()
end
vim.keymap.set("n", "<C-o>", require("fzf-lua").live_grep_native, {})
vim.keymap.set("n", "<C-l>", require("fzf-lua").buffers, {})
vim.keymap.set("n", "<C-k>", require("fzf-lua").lsp_definitions, {})
vim.keymap.set("n", "\"m", require("fzf-lua").manpages, {})
vim.keymap.set("n", "z.", require("fzf-lua").spell_suggest, {})
vim.keymap.set("n", ".", require("fzf-lua").lsp_code_actions, {
noremap = true, silent = true,
})
vim.keymap.set("n", ",", function() vim.diagnostic.open_float() end, {})
vim.keymap.set("n", "\"r", function() vim.lsp.buf.rename() end, {})
vim.keymap.set("n", ";", require("fzf-lua").diagnostics_workspace, {})
vim.keymap.set({ "n", "i", "v" }, "<C-s>", format_and_save)
vim.keymap.set({ "n", "v" }, "<CR>", "<cmd>Yazi<CR>", { noremap = true, silent = true, })
vim.keymap.set("t", "<ESC>e", "<C-\\><C-n>", { noremap = true })
vim.keymap.set("n", "<F5>", function() require("dap").continue() end)
vim.keymap.set("n", "<F10>", function() require("dap").step_over() end)
vim.keymap.set("n", "<F11>", function() require("dap").step_into() end)
vim.keymap.set("n", "<F12>", function() require("dap").step_out() end)
vim.keymap.set("n", "\"db", function() require("dap").toggle_breakpoint() end)
vim.keymap.set("n", "\"dl", function() require("dap").run_last() end)
vim.keymap.set({ "n", "v" }, "\"dh", function()
require("dap.ui.widgets").hover()
end)
vim.keymap.set("n", "<Space>cv", require("crates").show_versions_popup, {})
vim.keymap.set("n", "<Space>cf", require("crates").show_features_popup, {})
vim.keymap.set("n", "<Space>cd", require("crates").show_dependencies_popup, {})

View file

@ -0,0 +1,20 @@
vim.opt.clipboard = "unnamedplus"
vim.opt.mouse = 'a'
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.number = true
vim.opt.relativenumber = false
vim.opt.cursorline = true
vim.opt.spelllang = "en_gb"
vim.opt.spell = true
vim.lsp.inlay_hint.enable()
vim.g.loaded_netrwPlugin = 0
vim.opt.termguicolors = true

View file

@ -0,0 +1,39 @@
return {
"saghen/blink.cmp",
version = '*',
opts = {
keymap = {
["<cr>"] = { "accept", "fallback" },
["<S-Up>"] = { "scroll_documentation_up", "fallback" },
["<S-Down>"] = { "scroll_documentation_down", "fallback" },
},
appearance = {
nerd_font_variant = "normal"
},
completion = {
ghost_text = {
enabled = true,
},
list = {
selection = {
preselect = false,
auto_insert = false,
},
},
documentation = {
auto_show = true,
auto_show_delay_ms = 1000,
},
menu = {
draw = {
treesitter = {
"lsp"
},
},
},
},
signature = {
enabled = true,
}
},
}

View file

@ -0,0 +1,6 @@
return {
"numToStr/Comment.nvim",
opts = {
-- add any options here
}
}

View file

@ -0,0 +1,8 @@
return {
"saecki/crates.nvim",
event = { "BufRead Cargo.toml" },
tag = "stable",
config = function()
require("crates").setup()
end,
}

View file

@ -0,0 +1,26 @@
return {
"ibhagwan/fzf-lua",
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {
"skim",
fzf_opts = {
["--wrap"] = true,
}
},
config = function()
require("fzf-lua").setup({
diagnostics = {
multiline = true,
fzf_opts = {
["--wrap"] = true,
},
},
winopts = {
preview = {
layout = "vertical",
}
}
})
end
}

View file

@ -0,0 +1,14 @@
return {
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("lualine").setup({
options = {
theme = "auto"
-- theme = "horizon"
-- theme = "OceanicNext"
-- theme = "ayu_dark"
}
})
end,
}

View file

@ -0,0 +1,15 @@
return {
"williamboman/mason-lspconfig.nvim",
config = function()
require("mason").setup()
require("mason-lspconfig").setup({
ensure_installed = {
"lua_ls",
"clangd",
"ruff",
"pyright",
"cssls",
},
})
end,
}

View file

@ -0,0 +1,6 @@
return {
"williamboman/mason.nvim",
config = function()
require("mason").setup()
end,
}

View file

@ -0,0 +1,8 @@
return {
"windwp/nvim-autopairs",
event = "InsertEnter",
config = true
-- use opts = {} for passing setup options
-- this is equivalent to setup({}) function
}

View file

@ -0,0 +1,6 @@
return {
"mfussenegger/nvim-dap-python",
config = function()
require("dap-python").setup("python")
end
}

View file

@ -0,0 +1,21 @@
return {
"rcarriga/nvim-dap-ui",
dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
config = function()
require("dapui").setup()
local dap, dapui = require("dap"), require("dapui")
dap.listeners.before.attach.dapui_config = function()
dapui.open()
end
dap.listeners.before.launch.dapui_config = function()
dapui.open()
end
dap.listeners.before.event_terminated.dapui_config = function()
dapui.close()
end
dap.listeners.before.event_exited.dapui_config = function()
dapui.close()
end
end
}

View file

@ -0,0 +1,10 @@
return {
"theHamsta/nvim-dap-virtual-text",
config = function()
require("nvim-dap-virtual-text").setup({
all_references = true,
only_first_definition = false,
highlight_new_as_changed = true,
})
end
}

View file

@ -0,0 +1,51 @@
return {
"mfussenegger/nvim-dap",
config = function()
local dap = require("dap")
dap.adapters.gdb = {
type = "executable",
command = "gdb",
args = { "--interpreter=dap", "--eval-command", "set print pretty on" }
}
local gdb = {
{
name = "Launch",
type = "gdb",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = "${workspaceFolder}",
stopAtBeginningOfMainSubprogram = false,
},
{
name = "Select and attach to process",
type = "gdb",
request = "attach",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
pid = function()
local name = vim.fn.input('Executable name (filter): ')
return require("dap.utils").pick_process({ filter = name })
end,
cwd = '${workspaceFolder}'
},
{
name = 'Attach to gdbserver :1234',
type = 'gdb',
request = 'attach',
target = 'localhost:1234',
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = '${workspaceFolder}'
},
}
dap.configurations.c = gdb
dap.configurations.asm = gdb
dap.configurations.cpp = gdb
end
}

View file

@ -0,0 +1,6 @@
return {
"brenoprata10/nvim-highlight-colors",
config = function()
require("nvim-highlight-colors").setup({})
end
}

View file

@ -0,0 +1,40 @@
return {
"neovim/nvim-lspconfig",
dependencies = { "saghen/blink.cmp" },
opts = {
servers = {
lua_ls = {}
}
},
config = function()
local capabilities = require("blink.cmp").get_lsp_capabilities()
local lspconfig = require("lspconfig")
lspconfig["lua_ls"].setup({ capabilities = capabilities })
lspconfig["clangd"].setup({ capabilities = capabilities })
lspconfig["pyright"].setup({
settings = {
pyright = {
disableOrganizeImpors = true,
},
python = {
analysis = {
ignore = { "*" }
}
}
},
capabilities = capabilities
})
lspconfig["ruff"].setup({
init_options = {
settings = {
logLevel = "trace",
},
},
capabilities = capabilities,
})
lspconfig["cssls"].setup({ capabilities = capabilities })
end
}

View file

@ -0,0 +1,11 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
require("nvim-treesitter.configs").setup({
auto_install = true,
highlight = { enabled = true },
indent = { enabled = true },
})
end,
}

View file

@ -0,0 +1,12 @@
return {
"mrcjkb/rustaceanvim",
version = "^5",
lazy = false,
config = function()
vim.g.rustaceanvim = {
tools = {
enable_clippy = false,
},
}
end
}

View file

@ -0,0 +1,93 @@
return {
"catppuccin/nvim",
name = "catppuccin",
priority = 1000,
config = function()
require("catppuccin").setup({
flavour = "macchiato",
transparent_background = true,
})
vim.cmd.colorscheme("catppuccin")
end
}
-- return {
-- "folke/tokyonight.nvim",
-- lazy = false,
-- priority = 1000,
-- config = function()
-- vim.cmd.colorscheme("tokyonight-storm")
-- end,
-- opts = {},
-- }
-- return {
-- "ellisonleao/gruvbox.nvim",
-- priority = 1000,
-- config = function()
-- require("gruvbox").setup({
-- contrast = "hard",
-- transparent_mode = true,
-- })
-- vim.cmd.colorscheme("gruvbox")
-- end,
-- }
-- return {
-- "akinsho/horizon.nvim",
-- version = "*",
-- config = function()
-- vim.cmd.colorscheme("horizon")
-- vim.o.background = "dark"
-- end
-- }
-- return {
-- 'f4z3r/gruvbox-material.nvim',
-- name = 'gruvbox-material',
-- lazy = false,
-- priority = 1000,
-- opts = {
-- contrast = "hard",
-- enable_bold = 1,
-- ui_contrast = "high"
-- },
-- }
-- return {
-- "Shatur/neovim-ayu",
-- config = function()
-- require("ayu").setup({
-- mirage = false,
-- terminal = true,
-- })
-- vim.cmd.colorscheme("ayu-dark")
-- end
-- }
-- return {
-- 'ray-x/aurora',
-- init = function()
-- vim.g.aurora_italic = 0
-- vim.g.aurora_transparent = 1
-- vim.g.aurora_bold = 1
-- end,
-- config = function()
-- vim.cmd.colorscheme "aurora"
-- end
-- }
-- return {
-- "sainnhe/everforest",
-- config = function()
-- vim.g.everforest_transparent_background = 2
-- vim.g.everforest_float_style = "dim"
-- vim.g.everforest_diagnostic_text_highlight = 1
-- vim.g.everforest_diagnostic_line_highlight = 1
-- vim.g.everforest_diagnostic_virtual_text = "highlighted"
-- vim.g.everforest_dim_inactive_windows = 1
-- vim.g.everforest_ui_contrast = "high"
-- vim.g.everforest_better_performans = 1
-- vim.cmd.colorscheme("everforest")
-- end
-- }

View file

@ -0,0 +1,3 @@
return {
"mikavilpas/yazi.nvim"
}