added plugins to nvim
This commit is contained in:
parent
b76ed824de
commit
e0a69b7ae9
6 changed files with 69 additions and 17 deletions
|
@ -1,3 +1,6 @@
|
|||
-- disable netrw at the very start of your init.lua (strongly advised)
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
----------------------
|
||||
-- general settings --
|
||||
----------------------
|
||||
|
|
|
@ -8,3 +8,6 @@ map('n', '<Space>', '', {})
|
|||
map('n', '<Leader>n', '<cmd>:bNext<CR>', {})
|
||||
map('n', '<Leader>p', '<cmd>:bprevious<CR>', {})
|
||||
map('n', '<Leader>h', '<cmd>:nohlsearch<CR>', {})
|
||||
|
||||
-- nvim-tree mappings
|
||||
map('n', '<Leader>t', '<cmd>:NvimTreeToggle<CR>', {})
|
||||
|
|
|
@ -3,27 +3,36 @@
|
|||
-------------
|
||||
require "paq" {
|
||||
"savq/paq-nvim"; -- Let Paq manage itself
|
||||
-- general plugins
|
||||
"nvim-lualine/lualine.nvim";
|
||||
{ 'kyazdani42/nvim-web-devicons', opt=true };
|
||||
'romgrk/barbar.nvim';
|
||||
'ggandor/lightspeed.nvim';
|
||||
|
||||
'neovim/nvim-lspconfig'; -- Configs for Nvim LSP
|
||||
'hrsh7th/nvim-cmp'; -- Autocompletion plugin
|
||||
'hrsh7th/cmp-nvim-lsp'; -- LSP source for nvim-cmp
|
||||
-- colorschemes --
|
||||
'rebelot/kanagawa.nvim';
|
||||
'folke/tokyonight.nvim';
|
||||
|
||||
-- code related --
|
||||
'neovim/nvim-lspconfig'; -- Configs for Nvim LSP
|
||||
'hrsh7th/nvim-cmp'; -- Autocompletion plugin
|
||||
'hrsh7th/cmp-nvim-lsp'; -- LSP source for nvim-cmp
|
||||
|
||||
'nvim-lua/plenary.nvim'; -- Dependency for telescope
|
||||
'nvim-telescope/telescope.nvim'; -- Fuzzy finder
|
||||
{'nvim-telescope/telescope-fzf-native.nvim', run='make' };
|
||||
'nvim-treesitter/nvim-treesitter'; -- Better syntax highlighting
|
||||
'nvim-tree/nvim-tree.lua'; -- File Explorer
|
||||
'numToStr/Comment.nvim'; -- Quickly comment lines
|
||||
'windwp/nvim-autopairs';
|
||||
'tpope/vim-surround';
|
||||
'lukas-reineke/indent-blankline.nvim';
|
||||
'ap/vim-css-color';
|
||||
|
||||
'L3MON4D3/LuaSnip'; -- Snippets plugin
|
||||
'saadparwaiz1/cmp_luasnip'; -- Snippets source for nvim-cmp
|
||||
|
||||
'nvim-treesitter/nvim-treesitter'; -- Better syntax highlighting
|
||||
|
||||
'windwp/nvim-autopairs';
|
||||
'tpope/vim-surround';
|
||||
'dhruvasagar/vim-table-mode';
|
||||
'lukas-reineke/indent-blankline.nvim';
|
||||
|
||||
'ap/vim-css-color';
|
||||
'rebelot/kanagawa.nvim';
|
||||
'folke/tokyonight.nvim';
|
||||
--'elkowar/yuck.vim';
|
||||
}
|
||||
|
||||
-- looks like tablemode for vim-table-mode in markdown
|
||||
|
@ -46,6 +55,14 @@ inoreabbrev <expr> __
|
|||
require'plugins.lualine'
|
||||
require'plugins.nvim-treesitter'
|
||||
require'plugins.nvim-cmp'
|
||||
require'plugins.telescope'
|
||||
|
||||
require'Comment'.setup()
|
||||
require'nvim-tree'.setup()
|
||||
require'indent_blankline'.setup{
|
||||
show_current_context = true,
|
||||
}
|
||||
-- setup barbar
|
||||
require'bufferline'.setup{
|
||||
icons = false,
|
||||
}
|
||||
|
|
|
@ -37,8 +37,10 @@ cmp.setup {
|
|||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'path'},
|
||||
{ name = 'nvim_lsp', keywordlength=3 },
|
||||
{ name = 'buffer', keywordlength=3 },
|
||||
{ name = 'luasnip', keywordlength=2 },
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -50,6 +52,9 @@ cmp.event:on(
|
|||
})
|
||||
)
|
||||
|
||||
--------------------
|
||||
-- Configure LSPs --
|
||||
--------------------
|
||||
-- require'lspconfig'.pylsp.setup{}
|
||||
|
||||
-- Add additional capabilities supported by nvim-cmp
|
||||
|
@ -59,9 +64,11 @@ capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
|
|||
local lspconfig = require('lspconfig')
|
||||
|
||||
-- Enable some language servers with the additional completion capabilities offered by nvim-cmp
|
||||
local servers = { 'clangd', 'rust_analyzer', 'pylsp', 'tsserver' }
|
||||
local servers = { 'clangd', 'rust_analyzer', 'pylsp', 'tsserver', 'jdtls' }
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup {
|
||||
capabilities = capabilities,
|
||||
}
|
||||
end
|
||||
|
||||
vim.opt.completeopt = {'menu', 'menuone', 'noselect'}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = { "lua", "python" },
|
||||
ensure_installed = { "lua", "python", "java" },
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
|
22
.config/nvim/lua/plugins/telescope.lua
Normal file
22
.config/nvim/lua/plugins/telescope.lua
Normal file
|
@ -0,0 +1,22 @@
|
|||
require('telescope').setup{
|
||||
defaults = {
|
||||
-- Default configuration for telescope goes here:
|
||||
-- config_key = value,
|
||||
mappings = {
|
||||
i = {
|
||||
-- map actions.which_key to <C-h> (default: <C-/>)
|
||||
-- actions.which_key shows the mappings for your picker,
|
||||
-- e.g. git_{create, delete, ...}_branch for the git_branches picker
|
||||
["<C-h>"] = "which_key"
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
require('telescope').load_extension('fzf')
|
||||
|
||||
-- mappings --
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', 'ff', builtin.find_files, {})
|
||||
vim.keymap.set('n', 'fg', builtin.live_grep, {})
|
||||
vim.keymap.set('n', 'fb', builtin.buffers, {})
|
||||
vim.keymap.set('n', 'fh', builtin.help_tags, {})
|
Loading…
Reference in a new issue