update nvim config

This commit is contained in:
LordMZTE 2021-08-31 22:24:12 +02:00
parent 653bc8c9f5
commit a33d26d45d
2 changed files with 25 additions and 3 deletions

View file

@ -44,9 +44,12 @@
"filetypes": [
"mun"
]
}
},
"zls" : {
"command": "zls",
"filetypes": ["zig"]
}
},
"java.format.enabled": true,
"java.format.onType.enabled": true,
"java.format.settings.url": "/home/lordmzte/.config/coc/extensions/node_modules/redhat.java/https:/raw.githubusercontent.com/google/styleguide/gh-pages/eclipse-java-google-style.xml"
"java.format.onType.enabled": true
}

View file

@ -12,3 +12,22 @@ vim.g.coc_global_extensions = {
"coc-tabnine",
"coc-toml",
}
local function check_back_space()
local col = vim.fn.col(".") - 1
return col <= 0 or vim.fn.getline("."):sub(col, col):match("%s")
end
function tab_completion()
if vim.fn.pumvisible() > 0 then
return vim.api.nvim_replace_termcodes("<C-n>", true, true, true)
end
if check_back_space() then
return vim.api.nvim_replace_termcodes("<TAB>", true, true, true)
end
return vim.fn["coc#refresh"]()
end
vim.api.nvim_set_keymap("i", "<TAB>", "v:lua.tab_completion()", { expr = true, noremap = false })