mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
Compare commits
2 Commits
2c7e4aa87a
...
d40d87cb61
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d40d87cb61 | ||
|
|
81663c8f3c |
@ -47,10 +47,6 @@ 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
|
||||||
|
|||||||
2
init.lua
2
init.lua
@ -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.7.2"
|
local expected_ver = "0.8.0"
|
||||||
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
|
||||||
|
|||||||
@ -33,11 +33,8 @@ 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.resolved_capabilities.document_formatting then
|
if client.server_capabilities.documentFormattingProvider then
|
||||||
map("n", "<space>f", vim.lsp.buf.formatting_sync, { desc = "format code" })
|
map("n", "<space>f", vim.lsp.buf.format, { 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", {
|
||||||
@ -56,8 +53,7 @@ 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
|
if (cursor_pos[1] ~= vim.b.diagnostics_pos[1] or cursor_pos[2] ~= vim.b.diagnostics_pos[2])
|
||||||
(cursor_pos[1] ~= vim.b.diagnostics_pos[1] or cursor_pos[2] ~= vim.b.diagnostics_pos[2])
|
|
||||||
and #vim.diagnostic.get() > 0
|
and #vim.diagnostic.get() > 0
|
||||||
then
|
then
|
||||||
vim.diagnostic.open_float(nil, float_opts)
|
vim.diagnostic.open_float(nil, float_opts)
|
||||||
@ -68,7 +64,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.resolved_capabilities.document_highlight then
|
if client.server_capabilities.documentHighlightProvider then
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
hi! link LspReferenceRead Visual
|
hi! link LspReferenceRead Visual
|
||||||
hi! link LspReferenceText Visual
|
hi! link LspReferenceText Visual
|
||||||
|
|||||||
@ -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 = {}, -- list of language that will be disabled
|
disable = { 'help' }, -- list of language that will be disabled
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -262,9 +262,7 @@ 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 = function()
|
run = "cd app && npm install",
|
||||||
fn["mkdp#util#install"]()
|
|
||||||
end,
|
|
||||||
ft = { "markdown" },
|
ft = { "markdown" },
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user