feat: neovim better split direction, compile-mode.nvim, format config.lua
This commit is contained in:
@@ -11,6 +11,8 @@ vim.opt.wildmenu = true
|
|||||||
vim.opt.undofile = true
|
vim.opt.undofile = true
|
||||||
vim.opt.termguicolors = true
|
vim.opt.termguicolors = true
|
||||||
vim.opt.shell = "fish"
|
vim.opt.shell = "fish"
|
||||||
|
vim.opt.splitbelow = true
|
||||||
|
vim.opt.splitright = true
|
||||||
|
|
||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
vim.keymap.set("n", "<leader>n", "<cmd>Explore .<cr>", {})
|
vim.keymap.set("n", "<leader>n", "<cmd>Explore .<cr>", {})
|
||||||
@@ -33,8 +35,32 @@ vim.pack.add({
|
|||||||
"https://github.com/nvimtools/none-ls.nvim",
|
"https://github.com/nvimtools/none-ls.nvim",
|
||||||
"https://github.com/nvim-lua/plenary.nvim",
|
"https://github.com/nvim-lua/plenary.nvim",
|
||||||
"https://github.com/nvim-telescope/telescope.nvim",
|
"https://github.com/nvim-telescope/telescope.nvim",
|
||||||
|
"https://github.com/ej-shafran/compile-mode.nvim"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.g.compile_mode = {
|
||||||
|
default_command = "nix build",
|
||||||
|
recompile_no_fail = true,
|
||||||
|
buffer_name = "*compile*"
|
||||||
|
}
|
||||||
|
vim.keymap.set("n", "<leader>c", function()
|
||||||
|
local id = -1
|
||||||
|
local bufname = vim.g.compile_mode.buffer_name
|
||||||
|
for _, bufid in ipairs(vim.api.nvim_list_bufs()) do
|
||||||
|
local name = vim.api.nvim_buf_get_name(bufid)
|
||||||
|
if string.sub(name, -string.len(bufname)) == bufname then
|
||||||
|
id = bufid
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if id == -1 then
|
||||||
|
vim.cmd("Recompile")
|
||||||
|
else
|
||||||
|
vim.bo[id].buflisted = false
|
||||||
|
vim.api.nvim_buf_delete(id, { unload = false })
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
local file_types = { "rust", "zig", "haskell", "c", "cpp" }
|
local file_types = { "rust", "zig", "haskell", "c", "cpp" }
|
||||||
require("nvim-treesitter").install(file_types)
|
require("nvim-treesitter").install(file_types)
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
@@ -112,7 +138,8 @@ end
|
|||||||
|
|
||||||
vim.lsp.config("clangd", { cmd = { "clangd" }, filetypes = { "c", "cpp" } })
|
vim.lsp.config("clangd", { cmd = { "clangd" }, filetypes = { "c", "cpp" } })
|
||||||
vim.lsp.enable("clangd")
|
vim.lsp.enable("clangd")
|
||||||
vim.lsp.config("haskell-language-server", { cmd = {"haskell-language-server-wrapper", "--lsp"}, filetypes = {"haskell"}})
|
vim.lsp.config("haskell-language-server",
|
||||||
|
{ cmd = { "haskell-language-server-wrapper", "--lsp" }, filetypes = { "haskell" } })
|
||||||
vim.lsp.enable("haskell-language-server")
|
vim.lsp.enable("haskell-language-server")
|
||||||
vim.lsp.config("lua_ls", { cmd = { "lua-language-server" }, filetypes = { "lua" } })
|
vim.lsp.config("lua_ls", { cmd = { "lua-language-server" }, filetypes = { "lua" } })
|
||||||
vim.lsp.enable("lua_ls")
|
vim.lsp.enable("lua_ls")
|
||||||
|
|||||||
Reference in New Issue
Block a user