1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

Compare commits

..

No commits in common. "d40d87cb61a723104bbdd0dac533a16ed42eaf4f" and "2c7e4aa87aefcc32682d017eae9e3c1395ae8f2b" have entirely different histories.

5 changed files with 18 additions and 8 deletions

View File

@ -47,6 +47,10 @@ if not vim.g.is_mac then
vim.cmd [[language en_US.utf-8]] vim.cmd [[language en_US.utf-8]]
end end
-- use filetype.lua instead of filetype.vim
vim.g.do_filetype_lua = 1
vim.g.did_load_filetypes = 0
-- Disable loading certain plugins -- Disable loading certain plugins
-- Whether to load netrw by default, see https://github.com/bling/dotvim/issues/4 -- Whether to load netrw by default, see https://github.com/bling/dotvim/issues/4

View File

@ -12,7 +12,7 @@ local api = vim.api
local utils = require("utils") local utils = require("utils")
-- check if we have the latest stable version of nvim -- check if we have the latest stable version of nvim
local expected_ver = "0.8.0" local expected_ver = "0.7.2"
local nvim_ver = utils.get_nvim_version() local nvim_ver = utils.get_nvim_version()
if nvim_ver ~= expected_ver then if nvim_ver ~= expected_ver then

View File

@ -33,8 +33,11 @@ local custom_attach = function(client, bufnr)
end, { desc = "list workspace folder" }) end, { desc = "list workspace folder" })
-- Set some key bindings conditional on server capabilities -- Set some key bindings conditional on server capabilities
if client.server_capabilities.documentFormattingProvider then if client.resolved_capabilities.document_formatting then
map("n", "<space>f", vim.lsp.buf.format, { desc = "format code" }) 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" })
end end
api.nvim_create_autocmd("CursorHold", { api.nvim_create_autocmd("CursorHold", {
@ -53,8 +56,9 @@ local custom_attach = function(client, bufnr)
end end
local cursor_pos = api.nvim_win_get_cursor(0) 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]) if
and #vim.diagnostic.get() > 0 (cursor_pos[1] ~= vim.b.diagnostics_pos[1] or cursor_pos[2] ~= vim.b.diagnostics_pos[2])
and #vim.diagnostic.get() > 0
then then
vim.diagnostic.open_float(nil, float_opts) vim.diagnostic.open_float(nil, float_opts)
end end
@ -64,7 +68,7 @@ local custom_attach = function(client, bufnr)
}) })
-- The blow command will highlight the current variable and its usages in the buffer. -- The blow command will highlight the current variable and its usages in the buffer.
if client.server_capabilities.documentHighlightProvider then if client.resolved_capabilities.document_highlight then
vim.cmd([[ vim.cmd([[
hi! link LspReferenceRead Visual hi! link LspReferenceRead Visual
hi! link LspReferenceText Visual hi! link LspReferenceText Visual

View File

@ -3,6 +3,6 @@ require("nvim-treesitter.configs").setup {
ignore_install = {}, -- List of parsers to ignore installing ignore_install = {}, -- List of parsers to ignore installing
highlight = { highlight = {
enable = true, -- false will disable the whole extension enable = true, -- false will disable the whole extension
disable = { 'help' }, -- list of language that will be disabled disable = {}, -- list of language that will be disabled
}, },
} }

View File

@ -262,7 +262,9 @@ packer.startup {
if vim.g.is_win or vim.g.is_mac then if vim.g.is_win or vim.g.is_mac then
use { use {
"iamcco/markdown-preview.nvim", "iamcco/markdown-preview.nvim",
run = "cd app && npm install", run = function()
fn["mkdp#util#install"]()
end,
ft = { "markdown" }, ft = { "markdown" },
} }
end end