first commit
This commit is contained in:
commit
02f0def35e
16 changed files with 422 additions and 0 deletions
1
lua/plugins/autopairs.lua
Normal file
1
lua/plugins/autopairs.lua
Normal file
|
@ -0,0 +1 @@
|
|||
local autopair = require("nvim-autopairs").setup {}
|
1
lua/plugins/base16.lua
Normal file
1
lua/plugins/base16.lua
Normal file
|
@ -0,0 +1 @@
|
|||
vim.cmd.colorscheme 'base16-default-dark'
|
84
lua/plugins/cmp.lua
Normal file
84
lua/plugins/cmp.lua
Normal file
|
@ -0,0 +1,84 @@
|
|||
local has_words_before = function()
|
||||
unpack = unpack or table.unpack
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and vim.api.nvim_buf_get_lines(
|
||||
0,
|
||||
line - 1,
|
||||
line,
|
||||
true
|
||||
)[1]:sub(col, col):match('%s') == nil
|
||||
end
|
||||
|
||||
-- Add additional capabilities supported by nvim-cmp
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
local kind_icons = {
|
||||
Text = "",
|
||||
Method = "",
|
||||
Function = "",
|
||||
Constructor = "",
|
||||
Field = "",
|
||||
Variable = "",
|
||||
Class = "ﴯ",
|
||||
Interface = "",
|
||||
Module = "",
|
||||
Property = "ﰠ",
|
||||
Unit = "",
|
||||
Value = "",
|
||||
Enum = "",
|
||||
Keyword = "",
|
||||
Snippet = "",
|
||||
Color = "",
|
||||
File = "",
|
||||
Reference = "",
|
||||
Folder = "",
|
||||
EnumMember = "",
|
||||
Constant = "",
|
||||
Struct = "",
|
||||
Event = "",
|
||||
Operator = "",
|
||||
TypeParameter = ""
|
||||
}
|
||||
|
||||
-- nvim-cmp setup
|
||||
local cmp = require 'cmp'
|
||||
cmp.setup {
|
||||
mapping = {
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
|
||||
-- they way you will only jump inside the snippet region
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
},
|
||||
formatting = {
|
||||
format = function(_, vim_item)
|
||||
vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind)
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'path' },
|
||||
{ name = 'buffer' },
|
||||
},
|
||||
}
|
3
lua/plugins/gitsigns.lua
Normal file
3
lua/plugins/gitsigns.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
require('gitsigns').setup {
|
||||
keymaps = {}, -- NO default keybindings
|
||||
}
|
1
lua/plugins/lsp.lua
Normal file
1
lua/plugins/lsp.lua
Normal file
|
@ -0,0 +1 @@
|
|||
local lspconfig = require('lspconfig')
|
29
lua/plugins/lualine.lua
Normal file
29
lua/plugins/lualine.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
require('lualine').setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'base16',
|
||||
component_separators = { left = '|', right = '|'},
|
||||
section_separators = { left = '', right = ''},
|
||||
disabled_filetypes = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = true,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {'mode'},
|
||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'encoding', 'fileformat', 'filetype'},
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location'}
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'location'},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {}
|
||||
}
|
25
lua/plugins/mason.lua
Normal file
25
lua/plugins/mason.lua
Normal file
|
@ -0,0 +1,25 @@
|
|||
local mason = require("mason").setup{
|
||||
ensure_installed= {
|
||||
'shellcheck',
|
||||
'shfmt'
|
||||
}
|
||||
}
|
||||
local mason_lspconfig = require("mason-lspconfig").setup{
|
||||
ensure_installed={
|
||||
'ansiblels',
|
||||
'bashls'
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
require("mason-lspconfig").setup_handlers({
|
||||
-- The first entry (without a key) will be the default handler
|
||||
-- and will be called for each installed server that doesn't have
|
||||
-- a dedicated handler.
|
||||
function (server_name) -- default handler (optional)
|
||||
require("lspconfig")[server_name].setup {}
|
||||
end,
|
||||
-- Next, you can provide targeted overrides for specific servers.
|
||||
--
|
||||
})
|
13
lua/plugins/neotree.lua
Normal file
13
lua/plugins/neotree.lua
Normal file
|
@ -0,0 +1,13 @@
|
|||
local neotree = require 'neo-tree'
|
||||
|
||||
neotree.setup({
|
||||
event_handlers = {
|
||||
{
|
||||
event = "file_opened",
|
||||
handler = function(file_path)
|
||||
--auto close
|
||||
require("neo-tree").close_all()
|
||||
end
|
||||
},
|
||||
}
|
||||
})
|
22
lua/plugins/treesitter.lua
Normal file
22
lua/plugins/treesitter.lua
Normal file
|
@ -0,0 +1,22 @@
|
|||
-- Tree sitter
|
||||
local ts = require 'nvim-treesitter.configs'
|
||||
|
||||
ts.setup {
|
||||
ensure_installed = {
|
||||
'bash',
|
||||
'c',
|
||||
'cmake',
|
||||
'dockerfile',
|
||||
'latex',
|
||||
'lua',
|
||||
'markdown',
|
||||
'markdown_inline',
|
||||
'python',
|
||||
'yaml'
|
||||
},
|
||||
sync_install = false,
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
}
|
||||
}
|
2
lua/plugins/whichkey.lua
Normal file
2
lua/plugins/whichkey.lua
Normal file
|
@ -0,0 +1,2 @@
|
|||
local wk = require 'which-key'
|
||||
wk.register()
|
Reference in a new issue