Add project, remove sidebar, add plugins to telescope
This commit is contained in:
parent
eea2aaf71f
commit
08e3cd3509
|
@ -1,11 +1,14 @@
|
||||||
vim.g.loaded_netrw = 1
|
-- vim.g.loaded_netrw = 1
|
||||||
vim.g.loaded_netrwPlugin = 1
|
-- vim.g.loaded_netrwPlugin = 1
|
||||||
vim.opt.termguicolors = true
|
vim.opt.termguicolors = true
|
||||||
require('nvim-tree').setup {
|
require('nvim-tree').setup {
|
||||||
disable_netrw = true,
|
disable_netrw = false,
|
||||||
open_on_setup = true,
|
hijack_netrw = false,
|
||||||
open_on_setup_file = true,
|
open_on_setup = false,
|
||||||
|
open_on_setup_file = false,
|
||||||
hijack_cursor = true,
|
hijack_cursor = true,
|
||||||
|
sync_root_with_cwd = true,
|
||||||
|
respect_buf_cwd = true,
|
||||||
update_focused_file = {
|
update_focused_file = {
|
||||||
enable = true,
|
enable = true,
|
||||||
update_root = true,
|
update_root = true,
|
||||||
|
@ -27,6 +30,9 @@ require('nvim-tree').setup {
|
||||||
},
|
},
|
||||||
view = {
|
view = {
|
||||||
centralize_selection = true,
|
centralize_selection = true,
|
||||||
|
float = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
renderer = {
|
renderer = {
|
||||||
add_trailing = true,
|
add_trailing = true,
|
||||||
|
@ -44,4 +50,7 @@ require('nvim-tree').setup {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
filters = {
|
||||||
|
dotfiles = true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
40
config/nvim/lua/config_plugins/config_project.lua
Normal file
40
config/nvim/lua/config_plugins/config_project.lua
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
require("project_nvim").setup {
|
||||||
|
-- Manual mode doesn't automatically change your root directory, so you have
|
||||||
|
-- the option to manually do so using `:ProjectRoot` command.
|
||||||
|
manual_mode = false,
|
||||||
|
|
||||||
|
-- Methods of detecting the root directory. **"lsp"** uses the native neovim
|
||||||
|
-- lsp, while **"pattern"** uses vim-rooter like glob pattern matching. Here
|
||||||
|
-- order matters: if one is not detected, the other is used as fallback. You
|
||||||
|
-- can also delete or rearangne the detection methods.
|
||||||
|
detection_methods = { "pattern", "lsp" },
|
||||||
|
|
||||||
|
-- All the patterns used to detect root dir, when **"pattern"** is in
|
||||||
|
-- detection_methods
|
||||||
|
patterns = { ".git", ".venv", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" },
|
||||||
|
|
||||||
|
-- Table of lsp clients to ignore by name
|
||||||
|
-- eg: { "efm", ... }
|
||||||
|
ignore_lsp = {},
|
||||||
|
|
||||||
|
-- Don't calculate root dir on specific directories
|
||||||
|
-- Ex: { "~/.cargo/*", ... }
|
||||||
|
exclude_dirs = {},
|
||||||
|
|
||||||
|
-- Show hidden files in telescope
|
||||||
|
show_hidden = false,
|
||||||
|
|
||||||
|
-- When set to false, you will get a message when project.nvim changes your
|
||||||
|
-- directory.
|
||||||
|
silent_chdir = true,
|
||||||
|
|
||||||
|
-- What scope to change the directory, valid options are
|
||||||
|
-- * global (default)
|
||||||
|
-- * tab
|
||||||
|
-- * win
|
||||||
|
scope_chdir = 'all',
|
||||||
|
|
||||||
|
-- Path where project.nvim will store the project history for use in
|
||||||
|
-- telescope
|
||||||
|
datapath = vim.fn.stdpath("data"),
|
||||||
|
}
|
|
@ -1,17 +0,0 @@
|
||||||
require("sidebar-nvim").setup({
|
|
||||||
disable_default_keybindings = 0,
|
|
||||||
bindings = nil,
|
|
||||||
open = true,
|
|
||||||
side = "right",
|
|
||||||
initial_width = 35,
|
|
||||||
hide_statusline = false,
|
|
||||||
update_interval = 1000,
|
|
||||||
sections = { "git", "diagnostics", "symbols" },
|
|
||||||
section_separator = { "-----" },
|
|
||||||
section_title_separator = { "" },
|
|
||||||
containers = {
|
|
||||||
attach_shell = "/bin/sh", show_all = true, interval = 5000,
|
|
||||||
},
|
|
||||||
datetime = { format = "%a %b %d, %H:%M", clocks = { { name = "local" } } },
|
|
||||||
todos = { ignored_paths = { "~" } },
|
|
||||||
})
|
|
|
@ -1,10 +1,16 @@
|
||||||
require('telescope').load_extension('aerial')
|
|
||||||
require('telescope').load_extension('notify')
|
|
||||||
|
|
||||||
require('telescope.actions')
|
require('telescope.actions')
|
||||||
local trouble = require('trouble.providers.telescope')
|
local trouble = require('trouble.providers.telescope')
|
||||||
|
|
||||||
require('telescope').setup {
|
require('telescope').setup {
|
||||||
|
extensions = {
|
||||||
|
fzf = {
|
||||||
|
fuzzy = true, -- false will only do exact matching
|
||||||
|
override_generic_sorter = true, -- override the generic sorter
|
||||||
|
override_file_sorter = true, -- override the file sorter
|
||||||
|
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
||||||
|
-- the default case_mode is "smart_case"
|
||||||
|
},
|
||||||
|
},
|
||||||
defaults = {
|
defaults = {
|
||||||
mappings = {
|
mappings = {
|
||||||
i = { ["<c-t>"] = trouble.open_with_trouble },
|
i = { ["<c-t>"] = trouble.open_with_trouble },
|
||||||
|
@ -12,3 +18,8 @@ require('telescope').setup {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require('telescope').load_extension('fzf')
|
||||||
|
require('telescope').load_extension('aerial')
|
||||||
|
require('telescope').load_extension('notify')
|
||||||
|
require('telescope').load_extension('projects')
|
||||||
|
|
|
@ -13,6 +13,7 @@ end
|
||||||
vim.g.mapleader = ' '
|
vim.g.mapleader = ' '
|
||||||
-- Misc
|
-- Misc
|
||||||
imap('jk', '<Esc>')
|
imap('jk', '<Esc>')
|
||||||
|
nmap('<leader>hq', '<cmd>Gitsigns setqflist all<cr>')
|
||||||
nmap('<leader>gl', '<cmd>Git pull<cr>')
|
nmap('<leader>gl', '<cmd>Git pull<cr>')
|
||||||
nmap('<leader>gp', '<cmd>Git push<cr>')
|
nmap('<leader>gp', '<cmd>Git push<cr>')
|
||||||
nmap('<leader>cc', '<cmd>Git commit<cr>')
|
nmap('<leader>cc', '<cmd>Git commit<cr>')
|
||||||
|
@ -20,6 +21,7 @@ nmap('<leader>cc', '<cmd>Git commit<cr>')
|
||||||
-- Telescope
|
-- Telescope
|
||||||
nmap('<leader>;', '<cmd>Telescope builtin<cr>')
|
nmap('<leader>;', '<cmd>Telescope builtin<cr>')
|
||||||
nmap('<leader>ff', '<cmd>Telescope find_files<cr>')
|
nmap('<leader>ff', '<cmd>Telescope find_files<cr>')
|
||||||
|
nmap('<leader>fp', '<cmd>Telescope projects<cr>')
|
||||||
nmap('<leader>fa', '<cmd>Telescope aerial<cr>')
|
nmap('<leader>fa', '<cmd>Telescope aerial<cr>')
|
||||||
nmap('<leader>fd', '<cmd>Telescope lsp_document_symbols<cr>')
|
nmap('<leader>fd', '<cmd>Telescope lsp_document_symbols<cr>')
|
||||||
nmap('<leader>fe', '<cmd>Telescope diagnostics<cr>')
|
nmap('<leader>fe', '<cmd>Telescope diagnostics<cr>')
|
||||||
|
|
|
@ -85,9 +85,9 @@ require('packer').startup {
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'sidebar-nvim/sidebar.nvim',
|
"ahmedkhalf/project.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require 'config_plugins.config_sidebar'
|
require 'config_plugins.config_project'
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
|
@ -97,6 +97,10 @@ require('packer').startup {
|
||||||
require 'config_plugins.config_toggleterm'
|
require 'config_plugins.config_toggleterm'
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
use {
|
||||||
|
'nvim-telescope/telescope-fzf-native.nvim',
|
||||||
|
run = 'make'
|
||||||
|
}
|
||||||
use {
|
use {
|
||||||
'nvim-telescope/telescope.nvim',
|
'nvim-telescope/telescope.nvim',
|
||||||
branch = '0.1.x',
|
branch = '0.1.x',
|
||||||
|
@ -107,10 +111,6 @@ require('packer').startup {
|
||||||
require 'config_plugins.config_telescope'
|
require 'config_plugins.config_telescope'
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
use {
|
|
||||||
'nvim-telescope/telescope-fzf-native.nvim',
|
|
||||||
run = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build'
|
|
||||||
}
|
|
||||||
use {
|
use {
|
||||||
'michaelb/sniprun',
|
'michaelb/sniprun',
|
||||||
run = 'bash install.sh',
|
run = 'bash install.sh',
|
||||||
|
|
Loading…
Reference in a new issue