aboutsummaryrefslogtreecommitdiffstats
path: root/nvim
diff options
context:
space:
mode:
Diffstat (limited to 'nvim')
-rw-r--r--nvim/init.lua23
-rw-r--r--nvim/lua/plugins/blankline.lua5
-rw-r--r--nvim/lua/plugins/diagnostics.lua2
-rw-r--r--nvim/lua/plugins/filetypes.lua4
-rw-r--r--nvim/lua/plugins/init.lua11
-rw-r--r--nvim/lua/plugins/lualine.lua28
-rw-r--r--nvim/lua/plugins/nvim-cmp.lua8
-rw-r--r--nvim/lua/plugins/oil.lua16
8 files changed, 33 insertions, 64 deletions
diff --git a/nvim/init.lua b/nvim/init.lua
index f2fc6dd..dcbd2f8 100644
--- a/nvim/init.lua
+++ b/nvim/init.lua
@@ -8,24 +8,27 @@ HOSTNAME = vim.uv.os_gethostname()
-- bootstrap lazynvim if not installed
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
- vim.fn.system({
- "git",
- "clone",
- "--filter=blob:none",
- "https://github.com/folke/lazy.nvim.git",
- "--branch=stable", -- latest stable release
- lazypath,
- })
+ vim.fn.system({
+ "git",
+ "clone",
+ "--filter=blob:none",
+ "https://github.com/folke/lazy.nvim.git",
+ "--branch=stable", -- latest stable release
+ lazypath,
+ })
end
vim.opt.rtp:prepend(lazypath)
--- TODO: include local plugins
-- leader
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-require("lazy").setup('plugins')
+require("lazy").setup('plugins', {
+ dev = {
+ path = "~/src"
+ }
+})
require('keymap')
diff --git a/nvim/lua/plugins/blankline.lua b/nvim/lua/plugins/blankline.lua
index 9756c20..fe2e8d2 100644
--- a/nvim/lua/plugins/blankline.lua
+++ b/nvim/lua/plugins/blankline.lua
@@ -1,9 +1,6 @@
--- TODO: configure tree-sitter to color current indentation level
return {
'lukas-reineke/indent-blankline.nvim', -- show indentation levels
main = "ibl",
dependencies = 'nvim-treesitter/nvim-treesitter',
- opts = {
- scope = { enabled = true }
- }
+ opts = {}
}
diff --git a/nvim/lua/plugins/diagnostics.lua b/nvim/lua/plugins/diagnostics.lua
index 9406298..ca60f0a 100644
--- a/nvim/lua/plugins/diagnostics.lua
+++ b/nvim/lua/plugins/diagnostics.lua
@@ -16,7 +16,7 @@ return {
if vim.o.ft == "trouble" then
trouble.close(opts)
else
- trouble.focus()
+ trouble.focus("diagnostics")
end
else
trouble.open(opts)
diff --git a/nvim/lua/plugins/filetypes.lua b/nvim/lua/plugins/filetypes.lua
index bafb528..d2e4bb9 100644
--- a/nvim/lua/plugins/filetypes.lua
+++ b/nvim/lua/plugins/filetypes.lua
@@ -16,6 +16,10 @@ return {
lazy = true
},
{
+ 'ap/vim-css-color',
+ ft = { 'css', 'scss', 'sass' }
+ },
+ {
'kristijanhusak/vim-dadbod-completion',
ft = { 'sql', 'mysql', 'plsql' },
lazy = true
diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua
index 12d22b1..9031f35 100644
--- a/nvim/lua/plugins/init.lua
+++ b/nvim/lua/plugins/init.lua
@@ -3,7 +3,6 @@ return {
-- common dependacy
"nvim-lua/plenary.nvim",
-
{
'numToStr/Comment.nvim', -- faster commentting
event = 'BufEnter',
@@ -14,19 +13,9 @@ return {
}
},
},
-
{
"j-hui/fidget.nvim",
event = { 'LspAttach' },
opts = {}
},
-
- {
- 'ap/vim-css-color',
- ft = { 'css', 'scss', 'sass' }
- },
-
- -- cosmetic
- -- 'kyazdani42/nvim-web-devicons',
-
}
diff --git a/nvim/lua/plugins/lualine.lua b/nvim/lua/plugins/lualine.lua
index 07515ee..397ec9a 100644
--- a/nvim/lua/plugins/lualine.lua
+++ b/nvim/lua/plugins/lualine.lua
@@ -1,34 +1,10 @@
return {
- 'nvim-lualine/lualine.nvim', -- lualine
- dependencies = { 'nvim-tree/nvim-web-devicons', opt = true },
+ 'nvim-lualine/lualine.nvim',
+ dependencies = { 'nvim-tree/nvim-web-devicons' },
opts = {
options = {
theme = 'auto',
globalstatus = true,
},
- -- tabline = {
- -- lualine_a = {},
- -- lualine_b = {},
- -- lualine_c = {},
- -- lualine_x = {},
- -- lualine_y = {},
- -- lualine_z = {}
- -- },
- -- winbar = {
- -- lualine_a = {},
- -- lualine_b = {},
- -- lualine_c = {'filename'},
- -- lualine_x = {},
- -- lualine_y = {},
- -- lualine_z = {}
- -- },
- -- inactive_winbar = {
- -- lualine_a = {},
- -- lualine_b = {},
- -- lualine_c = {'filename'},
- -- lualine_x = {'location'},
- -- lualine_y = {},
- -- lualine_z = {}
- -- },
},
}
diff --git a/nvim/lua/plugins/nvim-cmp.lua b/nvim/lua/plugins/nvim-cmp.lua
index a3b32f7..1a4a66c 100644
--- a/nvim/lua/plugins/nvim-cmp.lua
+++ b/nvim/lua/plugins/nvim-cmp.lua
@@ -95,7 +95,6 @@ local cmp_pandoc = {
}
local cmp_lsp = {
- -- TODO: lazy load on lsp load
'hrsh7th/cmp-nvim-lsp',
event = 'LspAttach',
dependencies = {
@@ -173,7 +172,6 @@ local cmp = {
{ name = 'luasnip' },
{ name = 'nvim_lsp' },
{ name = 'nvim_lua' },
- { name = 'luansip' },
{ name = 'buffer' },
{ name = 'path' }
}
@@ -181,6 +179,7 @@ local cmp = {
cmp.setup.filetype({ "sql" }, {
sources = {
{ name = 'vim-dadbod-completion' },
+ { name = 'nvim_lsp' },
{ name = 'buffer' }
}
})
@@ -197,9 +196,4 @@ return {
cmp_buffer,
-- cmp_pandoc,
cmp,
-
- -- {
- -- 'kdheepak/cmp-latex-symbols',
- -- dependencies = { 'hrsh7th/nvim-cmp' }
- -- },
}
diff --git a/nvim/lua/plugins/oil.lua b/nvim/lua/plugins/oil.lua
index 890e05d..0c0a2c3 100644
--- a/nvim/lua/plugins/oil.lua
+++ b/nvim/lua/plugins/oil.lua
@@ -1,3 +1,4 @@
+local oil_winnr = nil
return {
'stevearc/oil.nvim',
lazy = false,
@@ -8,13 +9,18 @@ return {
keys = { {
"<leader>ef",
function()
- local filetype = vim.o.ft
- if filetype == "oil" then
- vim.cmd('q')
+ if not oil_winnr or not vim.api.nvim_win_is_valid(oil_winnr) then
+ vim.cmd("topleft vsplit +Oil")
+ oil_winnr = vim.api.nvim_get_current_win()
+ return
+ end
+
+ if vim.api.nvim_get_current_win() == oil_winnr then
+ vim.api.nvim_win_close(oil_winnr, false)
+ oil_winnr = nil
else
- vim.cmd('topleft vsplit +Oil')
+ vim.api.nvim_set_current_win(oil_winnr)
end
- -- TODO: check for other open oil instances
end,
desc = "Open Oil file explorer in a far left split, similar to :Lexplore"
} },