feat: add editorconfig / treeview support

This commit is contained in:
Klesh Wong 2022-07-07 23:29:02 +08:00
parent 6bc8fc6104
commit e1965e6441
7 changed files with 23 additions and 7 deletions

View File

@ -27,6 +27,7 @@ if status is-interactive
# === nnn configuration
set -gx NNN_PLUG 'c:fzcd;m:nmount;x:!chmod +x $nnn;X:!chmod -x $nnn;d:dragdrop;p:preview-tui'
set -gx NNN_FIFO /tmp/nnn.fifo
set -gx NNN_ARCHIVE '\.(7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)$'
# === bat configuration
set -gx BAT_THEME 'OneHalfDark'

View File

@ -23,6 +23,7 @@ vim.o.mouse = "a"
-- window options
vim.wo.number = true
vim.wo.relativenumber = true
-- more
require("keybindings")

View File

@ -25,6 +25,8 @@ keymap(NORMAL, '<leader>l', '<c-w>l', { noremap = true })
keymap(NORMAL, '<leader>oo', '<c-w>o', { noremap = true })
keymap(NORMAL, '<leader><esc>', ':noh<cr>', { noremap = true })
keymap(NORMAL, '<c-p>', ':Telescope find_files follow=true<cr>', { noremap = true })
keymap(NORMAL, '<leader>t', ':NvimTreeToggle<cr>', { noremap = true })
keymap(NORMAL, '<leader>tf', ':NvimTreeFindFile<cr>', { noremap = true })
keymap(NORMAL, '<leader>ts', ':Telescope live_grep<cr>', { noremap = true })
keymap(NORMAL, '<leader>tt', ':Telescope file_browser path=%:p:h<cr>', { noremap = true })
keymap(NORMAL, '<leader>tb', ':Telescope buffers', { noremap = true })

View File

@ -6,6 +6,7 @@ require("packer").startup(function(use)
use "jiangmiao/auto-pairs"
use "tpope/vim-fugitive"
use "ellisonleao/gruvbox.nvim"
use "editorconfig/editorconfig-vim"
-- nvim-surround
use({
@ -18,7 +19,7 @@ require("packer").startup(function(use)
"nvim-telescope/telescope.nvim",
requires = { {"nvim-lua/plenary.nvim"} },
}
use "nvim-telescope/telescope-file-browser.nvim"
-- use "nvim-telescope/telescope-file-browser.nvim"
-- bufferline
use {
@ -48,6 +49,9 @@ require("packer").startup(function(use)
-- comment
use "numToStr/Comment.nvim"
-- filetree
use "kyazdani42/nvim-tree.lua"
end)
@ -56,3 +60,4 @@ require("plugins/lsp")
require("plugins/bufferline")
require("plugins/statusline")
require("plugins/comment")
require("plugins/tree")

View File

@ -54,10 +54,11 @@ if not cmp_status_ok then
return
end
local luasnip_status_ok, luasnip = pcall(require, "luasnip")
cmp.setup {
snippet = {
expand = function(args)
local luasnip_status_ok, luasnip = pcall(require, "luasnip")
if luasnip_status_ok then
luasnip.lsp_expand(args.body)
end
@ -74,7 +75,7 @@ cmp.setup {
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
elseif luasnip_status_ok and luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
@ -83,7 +84,7 @@ cmp.setup {
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
elseif luasnip_status_ok and luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()

View File

@ -3,10 +3,9 @@ if not telescope_ok then
return
end
telescope.load_extension "file_browser"
-- telescope.load_extension "file_browser"
telescope.setup({
extensions = {
file_browser = {
}
-- file_browser = {}
}
})

View File

@ -0,0 +1,7 @@
local nvim_tree_ok, nvim_tree = pcall(require, "nvim-tree")
if not nvim_tree_ok then
return
end
nvim_tree.setup{}