all repos — dotfiles @ 3a228a1a58d1b878309fa9e47f387d1e2a20db29

linux dotfiles

nvim: add new nvim-tree mapping options
Prithu Goswami pg@prithu.dev
Mon, 12 Jun 2023 14:49:01 +0530
commit

3a228a1a58d1b878309fa9e47f387d1e2a20db29

parent

770b7e772aa25e19e9df442bcb4a742c7d3dca6c

2 files changed, 12 insertions(+), 9 deletions(-)

jump to
M config/nvim/init.luaconfig/nvim/init.lua

@@ -5,8 +5,19 @@ require 'completion'

require 'lsp' -- TODO move each plugin setup to own file +local function nvim_tree_on_attach(bufnr) + local api = require('nvim-tree.api') + local function opts(desc) + return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true } + end + api.config.mappings.default_on_attach(bufnr) + vim.keymap.set('n', 't', api.node.open.tab, opts('Open: New Tab')) + vim.keymap.set('n', '<C-s>', api.node.open.horizontal, opts('Open: Horizontal Split')) +end + require("nvim-tree").setup({ + on_attach = nvim_tree_on_attach, sort_by = "case_sensitive", filters = { custom = {"__pycache__"}

@@ -34,14 +45,6 @@ untracked = "★",

deleted = "✗", ignored = "◌", } - } - } - }, - view = { - mappings = { - list = { - { key = "t", action = "tabnew"}, - { key = "<C-s>", action = "split"} } } },
M config/nvim/lua/options.luaconfig/nvim/lua/options.lua

@@ -8,7 +8,7 @@ vim.opt.undofile = true

--o.colorcolumn = '80' vim.opt.scrolloff = 10 vim.opt.sidescrolloff = 10 -vim.opt.wrap = false +vim.opt.wrap = true vim.opt.mouse = 'a' vim.opt.wildmenu = true vim.opt.showmatch = true