Skip to content

Commit

Permalink
Update master from fork (#1)
Browse files Browse the repository at this point in the history
* use init for colorscheme (nvim-lua#715)

* README.md: update neo-tree example - remove legacy setting (nvim-lua#744)

* feat: allow treesitter defaults to be overwritten from custom directory (nvim-lua#732)

* chore: rename <C-T> to <C-t> for consistency (nvim-lua#719)

* Added folke/neodev.nvim for proper nvim api completion and annotation (nvim-lua#754)

Fixes nvim-lua#692

`neodev` configures Lua LSP for your Neovim config, runtime and plugins
used for completion, annotations and signatures of Neovim apis

With neodev, there's no more need to manually set lua_ls workspace
settings which don't seem to work properly anyway as currently nvim
api completion does not work.

* Use `cmp-nvim-lua` as `nvim-cmp` source for neovim Lua API (nvim-lua#696)

* Use cmp-nvim-lua as nvim-cmp source for neovim Lua API

* Move the dependency to a more suitable place

* Revert "Use `cmp-nvim-lua` as `nvim-cmp` source for neovim Lua API (nvim-lua#696)" (nvim-lua#755)

This reverts commit d8a1dbc.

* doc: add info about timeoutlen (nvim-lua#691)

Add separate comment for `timeoutlen` option
`timeoutlen` option was under unrelated comment with `updatetime` option.

* Add <C-b>/<C-f> cmp mapping to scroll cmp docs (nvim-lua#750)

* Move friendly snippets to dependencies of LuaSnip (nvim-lua#759)

Co-authored-by: TJ DeVries <[email protected]>

* doc: add note about advanced luasnip features

---------

Co-authored-by: name.tar.xz <[email protected]>
Co-authored-by: Damjan 9000 <[email protected]>
Co-authored-by: Ryan Baumgardner <[email protected]>
Co-authored-by: Chiller Dragon <[email protected]>
Co-authored-by: James Karefylakis <[email protected]>
Co-authored-by: Chris Patti <[email protected]>
Co-authored-by: TLW <[email protected]>
Co-authored-by: Rafael Zasas <[email protected]>
Co-authored-by: Vladislav Grechannik <[email protected]>
Co-authored-by: TJ DeVries <[email protected]>
  • Loading branch information
11 people authored Mar 15, 2024
1 parent 8fae679 commit 2e0a250
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 32 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ This will install the tree plugin and add the command `:Neotree` for you. For mo
In the file: `lua/custom/plugins/filetree.lua`, add:

```lua
-- Unless you are still migrating, remove the deprecated commands from v1.x
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])

return {
"nvim-neo-tree/neo-tree.nvim",
version = "*",
Expand Down
65 changes: 36 additions & 29 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ vim.opt.signcolumn = 'yes'

-- Decrease update time
vim.opt.updatetime = 250

-- Decrease mapped sequence wait time
-- Displays which-key popup sooner
vim.opt.timeoutlen = 300

-- Configure how new splits should be opened
Expand Down Expand Up @@ -410,6 +413,10 @@ require('lazy').setup({
-- Useful status updates for LSP.
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
{ 'j-hui/fidget.nvim', opts = {} },

-- `neodev` configures Lua LSP for your Neovim config, runtime and plugins
-- used for completion, annotations and signatures of Neovim apis
{ 'folke/neodev.nvim', opts = {} },
},
config = function()
-- Brief Aside: **What is LSP?**
Expand Down Expand Up @@ -456,7 +463,7 @@ require('lazy').setup({

-- Jump to the definition of the word under your cursor.
-- This is where a variable was first declared, or where a function is defined, etc.
-- To jump back, press <C-T>.
-- To jump back, press <C-t>.
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')

-- Find references for the word under your cursor.
Expand Down Expand Up @@ -551,18 +558,6 @@ require('lazy').setup({
-- capabilities = {},
settings = {
Lua = {
runtime = { version = 'LuaJIT' },
workspace = {
checkThirdParty = false,
-- Tells lua_ls where to find all the Lua files that you have loaded
-- for your neovim configuration.
library = {
'${3rd}/luv/library',
unpack(vim.api.nvim_get_runtime_file('', true)),
},
-- If lua_ls is really slow on your computer, you can try this instead:
-- library = { vim.env.VIMRUNTIME },
},
completion = {
callSnippet = 'Replace',
},
Expand Down Expand Up @@ -640,6 +635,17 @@ require('lazy').setup({
end
return 'make install_jsregexp'
end)(),
dependencies = {
-- `friendly-snippets` contains a variety of premade snippets.
-- See the README about individual language/framework/plugin snippets:
-- https://github.com/rafamadriz/friendly-snippets
-- {
-- 'rafamadriz/friendly-snippets',
-- config = function()
-- require('luasnip.loaders.from_vscode').lazy_load()
-- end,
-- },
},
},
'saadparwaiz1/cmp_luasnip',

Expand All @@ -648,12 +654,6 @@ require('lazy').setup({
-- into multiple repos for maintenance purposes.
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',

-- If you want to add a bunch of pre-configured snippets,
-- you can use this plugin to help you. It even has snippets
-- for various frameworks/libraries/etc. but you will have to
-- set up the ones that are useful for you.
-- 'rafamadriz/friendly-snippets',
},
config = function()
-- See `:help cmp`
Expand All @@ -679,6 +679,10 @@ require('lazy').setup({
-- Select the [p]revious item
['<C-p>'] = cmp.mapping.select_prev_item(),

-- scroll the documentation window [b]ack / [f]orward
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),

-- Accept ([y]es) the completion.
-- This will auto-import if your LSP supports it.
-- This will expand snippets if the LSP sent a snippet.
Expand Down Expand Up @@ -707,6 +711,9 @@ require('lazy').setup({
luasnip.jump(-1)
end
end, { 'i', 's' }),

-- For more advanced luasnip keymaps (e.g. selecting choice nodes, expansion) see:
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
},
sources = {
{ name = 'nvim_lsp' },
Expand All @@ -723,9 +730,8 @@ require('lazy').setup({
--
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`
'folke/tokyonight.nvim',
lazy = false, -- make sure we load this during startup if it is your main colorscheme
priority = 1000, -- make sure to load this before all the other start plugins
config = function()
init = function()
-- Load the colorscheme here.
-- Like many other themes, this one has different styles, and you could load
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
Expand Down Expand Up @@ -780,17 +786,18 @@ require('lazy').setup({
{ -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
config = function()
opts = {
ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' },
-- Autoinstall languages that are not installed
auto_install = true,
highlight = { enable = true },
indent = { enable = true },
},
config = function(_, opts)
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`

---@diagnostic disable-next-line: missing-fields
require('nvim-treesitter.configs').setup {
ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' },
-- Autoinstall languages that are not installed
auto_install = true,
highlight = { enable = true },
indent = { enable = true },
}
require('nvim-treesitter.configs').setup(opts)

-- There are additional nvim-treesitter modules that you can use to interact
-- with nvim-treesitter. You should go explore a few and see what interests you:
Expand Down

0 comments on commit 2e0a250

Please sign in to comment.