Skip to content

Commit

Permalink
nvim 0.8 update
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhao committed Oct 4, 2022
1 parent 81663c8 commit d40d87c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
4 changes: 0 additions & 4 deletions core/globals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ if not vim.g.is_mac then
vim.cmd [[language en_US.utf-8]]
end

-- use filetype.lua instead of filetype.vim
vim.g.do_filetype_lua = 1
vim.g.did_load_filetypes = 0

-- Disable loading certain plugins

-- Whether to load netrw by default, see https://github.com/bling/dotvim/issues/4
Expand Down
2 changes: 1 addition & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ local api = vim.api
local utils = require("utils")

-- check if we have the latest stable version of nvim
local expected_ver = "0.7.2"
local expected_ver = "0.8.0"
local nvim_ver = utils.get_nvim_version()

if nvim_ver ~= expected_ver then
Expand Down
14 changes: 5 additions & 9 deletions lua/config/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,8 @@ local custom_attach = function(client, bufnr)
end, { desc = "list workspace folder" })

-- Set some key bindings conditional on server capabilities
if client.resolved_capabilities.document_formatting then
map("n", "<space>f", vim.lsp.buf.formatting_sync, { desc = "format code" })
end
if client.resolved_capabilities.document_range_formatting then
map("x", "<space>f", vim.lsp.buf.range_formatting, { desc = "range format" })
if client.server_capabilities.documentFormattingProvider then
map("n", "<space>f", vim.lsp.buf.format, { desc = "format code" })
end

api.nvim_create_autocmd("CursorHold", {
Expand All @@ -56,9 +53,8 @@ local custom_attach = function(client, bufnr)
end

local cursor_pos = api.nvim_win_get_cursor(0)
if
(cursor_pos[1] ~= vim.b.diagnostics_pos[1] or cursor_pos[2] ~= vim.b.diagnostics_pos[2])
and #vim.diagnostic.get() > 0
if (cursor_pos[1] ~= vim.b.diagnostics_pos[1] or cursor_pos[2] ~= vim.b.diagnostics_pos[2])
and #vim.diagnostic.get() > 0
then
vim.diagnostic.open_float(nil, float_opts)
end
Expand All @@ -68,7 +64,7 @@ local custom_attach = function(client, bufnr)
})

-- The blow command will highlight the current variable and its usages in the buffer.
if client.resolved_capabilities.document_highlight then
if client.server_capabilities.documentHighlightProvider then
vim.cmd([[
hi! link LspReferenceRead Visual
hi! link LspReferenceText Visual
Expand Down
2 changes: 1 addition & 1 deletion lua/config/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ require("nvim-treesitter.configs").setup {
ignore_install = {}, -- List of parsers to ignore installing
highlight = {
enable = true, -- false will disable the whole extension
disable = {}, -- list of language that will be disabled
disable = { 'help' }, -- list of language that will be disabled
},
}

0 comments on commit d40d87c

Please sign in to comment.