Many fixes
This commit is contained in:
parent
f059534f62
commit
e7ca29410d
7 changed files with 60 additions and 24 deletions
|
@ -1,8 +1,8 @@
|
|||
function isEmpty()
|
||||
return vim.api.nvim_buf_get_name(0) == ""
|
||||
or vim.fn.filereadable(vim.api.nvim_buf_get_name(0)) == 0
|
||||
or vim.fn.line("$") == 1 and vim.fn.col("$") == 1
|
||||
end
|
||||
--function isEmpty()
|
||||
--return vim.api.nvim_buf_get_name(0) == ""
|
||||
--or vim.fn.filereadable(vim.api.nvim_buf_get_name(0)) == 0
|
||||
--or vim.fn.line("$") == 1 and vim.fn.col("$") == 1
|
||||
--end
|
||||
|
||||
--vim.api.nvim_create_autocmd({ "VimEnter" }, {
|
||||
-- callback = function()
|
||||
|
@ -13,24 +13,32 @@ end
|
|||
--})
|
||||
|
||||
vim.api.nvim_create_autocmd("BufRead", {
|
||||
pattern = ".env*",
|
||||
command = "set filetype=sh",
|
||||
pattern = ".env*",
|
||||
command = "set filetype=sh",
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("BufRead", {
|
||||
pattern = ".*rc",
|
||||
command = "set filetype=sh",
|
||||
pattern = ".*rc",
|
||||
command = "set filetype=sh",
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("BufRead", {
|
||||
pattern = "Dockerfile.*",
|
||||
command = "set filetype=dockerfile",
|
||||
pattern = "Dockerfile.*",
|
||||
command = "set filetype=dockerfile",
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("BufRead", {
|
||||
callback = function()
|
||||
vim.cmd.CccHighlighterEnable()
|
||||
end,
|
||||
callback = function()
|
||||
vim.cmd.CccHighlighterEnable()
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
callback = function ()
|
||||
if vim.bo.filetype == 'neo-tree' then
|
||||
vim.api.nvim_command("stopinsert")
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
--vim.api.nvim_create_autocmd('BufEnter', {
|
||||
|
|
4
lua/plugins/autoclose.lua
Normal file
4
lua/plugins/autoclose.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
"m4xshen/autoclose.nvim",
|
||||
opts = {},
|
||||
}
|
|
@ -101,6 +101,13 @@ local on_attach = function(client, bufnr)
|
|||
end
|
||||
end
|
||||
|
||||
local gen_capabilities = function(cmp)
|
||||
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = cmp.default_capabilities(capabilities)
|
||||
end
|
||||
|
||||
|
||||
return {
|
||||
{
|
||||
"lvimuser/lsp-inlayhints.nvim",
|
||||
|
@ -146,8 +153,7 @@ return {
|
|||
|
||||
-- LSP
|
||||
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
|
||||
local capabilities = gen_capabilities(require("cmp_nvim_lsp"));
|
||||
|
||||
-- Install servers used
|
||||
mason_lspconfig.setup({
|
||||
|
@ -238,9 +244,13 @@ return {
|
|||
build = prereqs,
|
||||
opts = {
|
||||
server = {
|
||||
on_attach = on_attach
|
||||
on_attach = on_attach,
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
opts.server.capabilities = gen_capabilities(require("cmp_nvim_lsp"));
|
||||
require('rust-tools').setup(opts)
|
||||
end
|
||||
--config = function(_, opts)
|
||||
--require('rust-tools').setup(opts)
|
||||
--end
|
||||
|
|
3
lua/plugins/surround.lua
Normal file
3
lua/plugins/surround.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
"tpope/vim-surround",
|
||||
}
|
|
@ -11,7 +11,9 @@ return {
|
|||
{
|
||||
"<leader>ff",
|
||||
function()
|
||||
require("telescope.builtin").find_files()
|
||||
require("telescope.builtin").find_files({
|
||||
hidden = true
|
||||
})
|
||||
end,
|
||||
desc = "Find Files",
|
||||
},
|
||||
|
|
|
@ -29,7 +29,7 @@ require("util").keymaps({
|
|||
function()
|
||||
scratch(".txt")
|
||||
end,
|
||||
desc = "New text scratch file",
|
||||
desc = "New [t]e[xt] scratch file",
|
||||
},
|
||||
["<leader>sn"] = {
|
||||
function()
|
||||
|
@ -41,7 +41,7 @@ require("util").keymaps({
|
|||
function()
|
||||
scratch(".md")
|
||||
end,
|
||||
desc = "New markdown scratch file",
|
||||
desc = "New [m]ark[d]own scratch file",
|
||||
},
|
||||
["<leader>sq"] = {
|
||||
function()
|
||||
|
@ -53,19 +53,25 @@ require("util").keymaps({
|
|||
function()
|
||||
scratch(".ts")
|
||||
end,
|
||||
desc = "New ts scratch file",
|
||||
desc = "New [t]ype[s]cript scratch file",
|
||||
},
|
||||
["<leader>sb"] = {
|
||||
function()
|
||||
scratch(".sh")
|
||||
end,
|
||||
desc = "New shell scratch file",
|
||||
desc = "New [sh]ell scratch file",
|
||||
},
|
||||
["<leader>sj"] = {
|
||||
function()
|
||||
scratch(".js")
|
||||
end,
|
||||
desc = "New js scratch file",
|
||||
desc = "New [j]ava[s]cript scratch file",
|
||||
},
|
||||
["<leader>sr"] = {
|
||||
function()
|
||||
scratch(".rs")
|
||||
end,
|
||||
desc = "New [r]u[s]t scratch file",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue