Merge branch 'master' of https://github.com/bieniucieniu/nvim-config
This commit is contained in:
commit
74f90c60a0
10
init.lua
10
init.lua
|
|
@ -54,6 +54,8 @@ vim.opt.splitbelow = true
|
|||
vim.opt.list = false
|
||||
vim.opt.listchars = { trail = '·', nbsp = '␣', tab = ' ' }
|
||||
|
||||
vim.opt.wrap = false
|
||||
|
||||
vim.opt.tabstop = 2 -- Number of spaces that a <Tab> in the file counts for
|
||||
vim.opt.shiftwidth = 2 -- Number of spaces to use for each step of (auto)indent
|
||||
vim.opt.expandtab = true -- Use spaces instead of actual tab characters
|
||||
|
|
@ -86,6 +88,14 @@ vim.api.nvim_create_autocmd('TextYankPost', {
|
|||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'neo-tree',
|
||||
callback = function()
|
||||
vim.wo.winfixwidth = true
|
||||
end,
|
||||
})
|
||||
|
||||
require 'config.keymap'
|
||||
require 'config.lazy'
|
||||
|
||||
|
|
|
|||
|
|
@ -58,3 +58,18 @@ vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper win
|
|||
|
||||
-- [[ Basic Autocommands ]]
|
||||
-- See `:help lua-guide-autocommands`
|
||||
|
||||
-- buffers
|
||||
|
||||
local function close_other_buffers()
|
||||
local current = vim.api.nvim_get_current_buf()
|
||||
local bufs = vim.api.nvim_list_bufs()
|
||||
|
||||
for _, buf in ipairs(bufs) do
|
||||
if vim.api.nvim_buf_is_loaded(buf) and buf ~= current then
|
||||
vim.api.nvim_buf_delete(buf, { force = true })
|
||||
end
|
||||
end
|
||||
end
|
||||
vim.keymap.set('n', '<leader>bd', ':bd<CR>', { desc = 'Close current buffer' })
|
||||
vim.keymap.set('n', '<leader>bo', close_other_buffers, { desc = 'Close all buffers except current' })
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
return {
|
||||
'https://gitlab.com/gitlab-org/editor-extensions/gitlab.vim.git',
|
||||
-- Activate when a file is created/opened
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
-- Activate when a supported filetype is open
|
||||
ft = { 'go', 'javascript', 'python', 'ruby' },
|
||||
cond = function()
|
||||
-- Only activate if token is present in environment variable.
|
||||
-- Remove this line to use the interactive workflow.
|
||||
return vim.env.GITLAB_TOKEN ~= nil and vim.env.GITLAB_TOKEN ~= ''
|
||||
end,
|
||||
opts = {
|
||||
statusline = {
|
||||
-- Hook into the built-in statusline to indicate the status
|
||||
-- of the GitLab Duo Code Suggestions integration
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -98,8 +98,9 @@ return { -- Main LSP Configuration
|
|||
}
|
||||
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
local lspconfig = require 'lspconfig'
|
||||
|
||||
require('lspconfig').sourcekit.setup {
|
||||
lspconfig.sourcekit.setup {
|
||||
capabilities = {
|
||||
workspace = {
|
||||
didChangeWatchedFiles = {
|
||||
|
|
@ -109,6 +110,15 @@ return { -- Main LSP Configuration
|
|||
},
|
||||
}
|
||||
|
||||
lspconfig.omnisharp.setup {
|
||||
capabilities = capabilities,
|
||||
enable_roslyn_analysers = true,
|
||||
enable_import_completion = true,
|
||||
organize_imports_on_format = true,
|
||||
enable_decompilation_support = true,
|
||||
filetypes = { 'cs', 'vb', 'csproj', 'sln', 'slnx', 'props', 'csx', 'targets', 'tproj', 'slngen', 'fproj' },
|
||||
}
|
||||
|
||||
local servers = {
|
||||
lua_ls = {
|
||||
settings = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue