Update back to base config

This commit is contained in:
Saeed Afzal
2024-08-20 08:28:17 +01:00
parent 263a774e31
commit 7bd33bd2fb
12 changed files with 39 additions and 138 deletions

View File

@@ -1,20 +1,18 @@
local api = vim.api
-- Set cargo for .rs files
api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
pattern = { "*.rs" },
command = "compiler cargo"
})
-- Indentation for .go files
api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
pattern = { "*.go" },
callback = function()
vim.cmd [[Tabs 4]]
command = "compiler go"
end
})
-- Set tsc for .ts files
api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
pattern = { "*.ts", "*.tsx" },
command = "compiler tsc"

View File

@@ -21,12 +21,3 @@ map("n", "<leader>h", ":noh<CR>")
-- Replace (visual)
map("v", "<leader>r", "\"hy:%s/<C-r>h//g<left><left>")
-- Buffer manager
map("n", "<leader>b", ":lua require(\"buffer_manager.ui\").toggle_quick_menu()<CR>")
-- LSP
map("n", "<leader>lf", "<cmd>lua vim.lsp.buf.format { async = true }<CR>")
map("n", "<leader>la", "<cmd>lua vim.lsp.buf.code_action()<CR>")
map("n", "<leader>lr", "<cmd>lua vim.lsp.buf.rename()<CR>")
map("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>")

View File

@@ -1,4 +1,4 @@
local g, opt = vim.g, vim.opt
local g, opt, cmd = vim.g, vim.opt, vim.cmd
-- Settings
g.mapleader = " "
@@ -22,11 +22,8 @@ opt.showmode = false
opt.grepprg = "rg --vimgrep --smart-case"
opt.path = ".,**"
vim.cmd "set path-=node_modules/**"
vim.cmd "set wildignore-=*/node_modules/*"
-- Netrw
g.netrw_banner = 0
cmd "set path-=node_modules/**"
cmd "set wildignore-=*/node_modules/*"
-- Indentation
opt.expandtab = true

View File

@@ -1,4 +1,4 @@
local fn, api = vim.fn, vim.api
local fn, api, o, bo = vim.fn, vim.api, vim.o, vim.bo
local modes = {
["n"] = "NORMAL",
@@ -19,8 +19,8 @@ end
function StatusLine()
local filename = fn.expand("%:t")
local filetype = vim.bo.filetype
local lineinfo = fn.line(".") .. ":" .. vim.fn.col(".")
local filetype = bo.filetype
local lineinfo = fn.line(".") .. ":" .. fn.col(".")
local percent = fn.line(".") / fn.line("$") * 100
return table.concat {
@@ -35,4 +35,4 @@ function StatusLine()
}
end
vim.o.statusline = "%!luaeval('StatusLine()')"
o.statusline = "%!luaeval('StatusLine()')"