adjusted netrw; fixed ctrl+l in netrw

This commit is contained in:
2024-01-06 07:05:54 +01:00
parent fc104536c1
commit 3961a8710e
9 changed files with 97 additions and 51 deletions

View File

@@ -7,9 +7,11 @@ function Color(color)
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
vim.api.nvim_set_hl(0, "StatusLine", { bg = "none" })
-- If Vim thinks StatusLine and StatusLineNC are the same it overrides these settings
vim.api.nvim_set_hl(0, "StatusLineNC", { ctermbg = "#ff0000", bg = "none" })
vim.api.nvim_set_hl(0, "EndOfBuffer", { fg = "none", bg = "none" })
vim.api.nvim_set_hl(0, "StatusLineNC", { ctermbg = 0, bg = "none" })
vim.api.nvim_set_hl(0, "CursorLine", { link = "Visual" })
vim.api.nvim_set_hl(0, "Pmenu", { link = "Normal" })
vim.api.nvim_set_hl(0, "PmenuSel", { link = "Visual" })
vim.api.nvim_set_hl(0, "PmenuSbar", { link = "Normal" })
end
Color()
-- #1E1E2E

View File

@@ -4,21 +4,44 @@ lsp.preset("recommended")
require('mason').setup({})
require('mason-lspconfig').setup({
ensure_installed = {'tsserver', 'rust_analyzer', 'lua_ls'},
ensure_installed = { 'tsserver', 'rust_analyzer' },
handlers = {
lsp.default_setup
lsp.default_setup,
lua_ls = function()
local lua_opts = lsp.nvim_lua_ls()
require('lspconfig').lua_ls.setup(lua_opts)
end
}
})
require('lspconfig').yamlls.setup {
require('lspconfig').yamlls.setup({
on_attach = function(client, bufnr)
client.resolved_capabilities.document_formatting = true
end,
settings = {
yaml = {
customTags = { "!enemy", "!delay", "!composite" },
validate = false,
format = {
enable = true
}
}
}
})
require('lspconfig').tsserver.setup {
settings = {
typescript = {
preferences = {
quoteStype = 'single'
}
},
javascript = {
preferences = {
quoteStyle = 'single'
}
}
}
}
local cmp = require('cmp')
@@ -31,10 +54,14 @@ cmp_mappings['<Tab>'] = nil
cmp_mappings['<S-Tab>'] = nil
cmp.setup({
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered()
sources = {
{ name = 'path' },
{ name = 'nvim_lsp' },
{ name = 'nvim_lua' },
{ name = 'luasnip', keyword_length = 2 },
{ name = 'buffer', keyword_length = 3 },
},
formatting = lsp.cmp_format(),
mapping = cmp.mapping.preset.insert({
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
@@ -42,9 +69,8 @@ cmp.setup({
['<C-Space>'] = cmp.mapping.complete(),
['<Tab>'] = nil,
['<S-Tab>'] = nil
}),
})
})
lsp.set_preferences({
suggest_lsp_servers = false,
sign_icons = {

View File

@@ -1,6 +1,10 @@
require 'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = { "javascript", "typescript", "c", "lua", "vim", "vimdoc", "query" },
ensure_installed = { "javascript", "typescript", "c", "lua", "vim", "vimdoc", "query", "c_sharp", "css", "gitcommit", "html", "svelte", "yaml", "astro", "toml", "jsdoc", "json" },
tree_docs = {
enable = true
},
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,

9
lua/409/autocmd.lua Normal file
View File

@@ -0,0 +1,9 @@
vim.api.nvim_create_autocmd({ 'FileType' }, {
pattern = { '*.yaml' },
command = 'setlocal ts=2 sts=2 sw=2 expandtab indentkeys-=0# indentkeys-=<:>'
})
vim.api.nvim_create_autocmd({ 'FileType' }, {
pattern = { 'netrw' },
command = 'nnoremap <buffer> <C-l> <Cmd> TmuxNavigateRight<CR>'
})

View File

@@ -1,7 +1,3 @@
require('409.remap')
require('409.set')
vim.api.nvim_create_autocmd({ 'FileType' }, {
pattern = { '*.yaml' },
command = 'setlocal ts=2 sts=2 sw=2 expandtab indentkeys-=0# indentkeys-=<:>'
})
require('409.autocmd')

View File

@@ -21,6 +21,7 @@ return require('packer').startup(function(use)
}
use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' })
use('nvim-treesitter/nvim-tree-docs')
use{
'ThePrimeagen/harpoon',

View File

@@ -38,7 +38,7 @@ vim.keymap.set("n", "<leader><leader>", function()
vim.cmd("so")
end)
vim.keymap.set("n", "<C-h>", "<cmd> TmuxNavigateLeft<CR>");
vim.keymap.set("n", "<C-l>", "<cmd> TmuxNavigateRight<CR>");
vim.keymap.set("n", "<C-j>", "<cmd> TmuxNavigateDown<CR>");
vim.keymap.set("n", "<C-k>", "<cmd> TmuxNavigateUp<CR>");
vim.keymap.set({ "n", "x" }, "<C-h>", "<cmd> TmuxNavigateLeft<CR>");
vim.keymap.set({ "n", "x" }, "<C-l>", "<cmd> TmuxNavigateRight<CR>");
vim.keymap.set({ "n", "x" }, "<C-j>", "<cmd> TmuxNavigateDown<CR>");
vim.keymap.set({ "n", "x" }, "<C-k>", "<cmd> TmuxNavigateUp<CR>");

View File

@@ -31,3 +31,6 @@ vim.opt.isfname:append('@-@')
vim.opt.updatetime = 50
vim.g.mapleader = ' '
vim.g.netrw_browse_split = 0
vim.g.netrw_banner = 0
vim.g.netrw_winsize = 25

View File

@@ -119,6 +119,11 @@ _G.packer_plugins = {
path = "/home/j409/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
url = "https://github.com/neovim/nvim-lspconfig"
},
["nvim-tree-docs"] = {
loaded = true,
path = "/home/j409/.local/share/nvim/site/pack/packer/start/nvim-tree-docs",
url = "https://github.com/nvim-treesitter/nvim-tree-docs"
},
["nvim-treesitter"] = {
loaded = true,
path = "/home/j409/.local/share/nvim/site/pack/packer/start/nvim-treesitter",