Compare commits
No commits in common. "2934dd2ed9376e29d4aa60399a17e4b531d91e9c" and "7642c9482932cd18da974ef584924d04198fb1da" have entirely different histories.
2934dd2ed9
...
7642c94829
3
init.lua
3
init.lua
|
|
@ -1,7 +1,4 @@
|
||||||
require("config.looks")
|
|
||||||
|
|
||||||
require("config.lazy")
|
require("config.lazy")
|
||||||
|
|
||||||
require("config.behaviour")
|
require("config.behaviour")
|
||||||
require("config.keymap")
|
require("config.keymap")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,22 @@
|
||||||
-- Encoding
|
-- Encoding
|
||||||
vim.opt.encoding = "UTF-8"
|
vim.opt.encoding = "UTF-8"
|
||||||
|
|
||||||
|
-- Line numbers
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
vim.opt.cursorline = true
|
||||||
|
|
||||||
|
-- Formatting
|
||||||
|
-- -- Indent
|
||||||
|
vim.opt.shiftwidth = 4
|
||||||
|
vim.opt.tabstop = 4
|
||||||
|
vim.opt.autoindent = true
|
||||||
|
vim.opt.expandtab = false
|
||||||
|
|
||||||
-- Terminal
|
-- Terminal
|
||||||
--vim.opt.wildmenu = true
|
vim.opt.wildmenu = true
|
||||||
--vim.opt.showmatch = true
|
vim.opt.showcmd = true
|
||||||
|
vim.opt.showmatch = true
|
||||||
|
|
||||||
-- Mouse
|
-- Mouse
|
||||||
vim.opt.mouse = "a"
|
vim.opt.mouse = "a"
|
||||||
|
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
-- for colorizer.nvim
|
|
||||||
vim.o.termguicolors = true
|
|
||||||
|
|
||||||
-- Line numbers
|
|
||||||
vim.opt.number = true
|
|
||||||
vim.opt.relativenumber = true
|
|
||||||
vim.opt.cursorline = true
|
|
||||||
|
|
||||||
-- Commands
|
|
||||||
vim.opt.showcmd = true
|
|
||||||
|
|
||||||
-- Formatting
|
|
||||||
-- -- Indent
|
|
||||||
vim.opt.shiftwidth = 4
|
|
||||||
vim.opt.tabstop = 4
|
|
||||||
vim.opt.autoindent = true
|
|
||||||
vim.opt.expandtab = false
|
|
||||||
vim.opt.softtabstop = 4
|
|
||||||
|
|
||||||
|
|
@ -49,20 +49,18 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
event = { "InsertEnter", "CmdlineEnter", },
|
event = "InsertEnter",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- Snippet engine
|
-- Snippet engine
|
||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
"saadparwaiz1/cmp_luasnip",
|
"saadparwaiz1/cmp_luasnip",
|
||||||
|
|
||||||
|
|
||||||
-- Plugins
|
-- Plugins
|
||||||
"hrsh7th/cmp-buffer", -- indexer
|
"hrsh7th/cmp-buffer", -- indexer
|
||||||
"hrsh7th/cmp-path", -- Autocomplete for filesystem paths
|
"hrsh7th/cmp-path", -- Autocomplete for filesystem paths
|
||||||
"hrsh7th/cmp-cmdline", -- Autocomplete for vims commandline
|
"hrsh7th/cmp-cmdline", -- Autocomplete for vims commandline
|
||||||
"hrsh7th/cmp-nvim-lua", -- Autocomplete for vim options
|
"hrsh7th/cmp-nvim-lua", -- Autocomplete for vim options
|
||||||
|
|
||||||
-- Looks
|
|
||||||
"onsails/lspkind.nvim", -- Add symbols for type
|
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
|
|
@ -73,63 +71,12 @@ return {
|
||||||
require("luasnip").lsp_expand(args.body)
|
require("luasnip").lsp_expand(args.body)
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
view = {
|
|
||||||
entries = {
|
|
||||||
name = 'custom',
|
|
||||||
selection_order = 'near_cursor'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
formatting = {
|
|
||||||
format = require("lspkind").cmp_format({
|
|
||||||
mode = "symbol_text",
|
|
||||||
maxwidth = 50,
|
|
||||||
ellipsis_char = "...",
|
|
||||||
show_labelDetails = true,
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
sources = {
|
sources = {
|
||||||
{ name = "nvim_lsp" },
|
{ name = "nvim_lsp" },
|
||||||
{ name = "luasnip" },
|
{ name = "luasnip" },
|
||||||
{ name = "buffer" },
|
{ name = "buffer" },
|
||||||
{ name = "path" },
|
{ name = "path" },
|
||||||
},
|
},
|
||||||
mapping = {
|
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
if #cmp.get_entries() == 1 then
|
|
||||||
cmp.confirm({ select = true })
|
|
||||||
else
|
|
||||||
cmp.select_next_item()
|
|
||||||
end
|
|
||||||
--[[ Replace with your snippet engine (see above sections on this page)
|
|
||||||
elseif snippy.can_expand_or_advance() then
|
|
||||||
snippy.expand_or_advance()
|
|
||||||
elseif has_words_before() then
|
|
||||||
cmp.complete()
|
|
||||||
if #cmp.get_entries() == 1 then
|
|
||||||
cmp.confirm({ select = true })
|
|
||||||
end]]
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, { "i", "s" }),
|
|
||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_prev_item()
|
|
||||||
end
|
|
||||||
end, { "i", "s", "c" }),
|
|
||||||
["<CR>"] = cmp.mapping({
|
|
||||||
i = function(fallback)
|
|
||||||
if cmp.visible() and cmp.get_active_entry() then
|
|
||||||
cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false })
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
s = cmp.mapping.confirm({ select = true }),
|
|
||||||
c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace }),
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
enabled = function()
|
enabled = function()
|
||||||
local context = require("cmp.config.context")
|
local context = require("cmp.config.context")
|
||||||
-- disable in autocomplete in comments
|
-- disable in autocomplete in comments
|
||||||
|
|
@ -154,7 +101,5 @@ return {
|
||||||
matching = { disallow_symbol_nonprefix_matching = false }
|
matching = { disallow_symbol_nonprefix_matching = false }
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
},
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,6 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
-- Package installer (for LSPs)
|
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
opts = {}
|
opts = {}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
-- Highlight color codes (like #A3F041)
|
|
||||||
"norcalli/nvim-colorizer.lua",
|
|
||||||
-- event = { "BufNew" }, -- will not call autocmd when opening a file the first time
|
|
||||||
config = function()
|
|
||||||
require("colorizer").setup({'*'}, { RRGGBBAA = true })
|
|
||||||
|
|
||||||
-- trigger highlighting when opening a new buffer
|
|
||||||
vim.api.nvim_create_autocmd(
|
|
||||||
{ "BufNew", "BufRead" },
|
|
||||||
{
|
|
||||||
callback = function()
|
|
||||||
local colorizer = require("colorizer")
|
|
||||||
colorizer.attach_to_buffer(0, colorizer.get_buffer_options(0))
|
|
||||||
end
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue