feat(nvim): dap support, fix(nvim): eslint & prettier formatting
This commit is contained in:
parent
75524e6375
commit
24300b24ae
@ -56,44 +56,77 @@ map alt+right neighboring_window right
|
|||||||
map alt+up neighboring_window up
|
map alt+up neighboring_window up
|
||||||
|
|
||||||
# -------------------------------------------------------
|
# -------------------------------------------------------
|
||||||
# ------------------ Nord Color Scheme ------------------
|
# ----------------- 1984 Orwellian Theme ----------------
|
||||||
# -------------------------------------------------------
|
# -------------------------------------------------------
|
||||||
|
|
||||||
foreground #D8DEE9
|
foreground #f1f1f1
|
||||||
background #2E3440
|
background #2e2923
|
||||||
selection_foreground #000000
|
selection_foreground #000000
|
||||||
selection_background #FFFACD
|
selection_background #3fc4ce
|
||||||
url_color #0087BD
|
color0 #000000
|
||||||
cursor #81A1C1
|
color1 #e74946
|
||||||
|
color2 #4cb605
|
||||||
|
color3 #fcd395
|
||||||
|
color4 #356fe4
|
||||||
|
color5 #fcbe95
|
||||||
|
color6 #3fc4ce
|
||||||
|
color7 #f1f1f1
|
||||||
|
color8 #000000
|
||||||
|
color9 #e74946
|
||||||
|
color10 #4cb605
|
||||||
|
color11 #fcd395
|
||||||
|
color12 #356fe4
|
||||||
|
color13 #fcbe95
|
||||||
|
color14 #3fc4ce
|
||||||
|
color15 #f1f1f1
|
||||||
|
|
||||||
# Black
|
# URL styles
|
||||||
color0 #3B4252
|
url_color #e74946
|
||||||
color8 #4C566A
|
url_style single
|
||||||
|
|
||||||
# Red
|
# Cursor styles
|
||||||
color1 #BF616A
|
cursor #3fc4ce
|
||||||
color9 #BF616A
|
|
||||||
|
|
||||||
# Green
|
|
||||||
color2 #A3BE8C
|
|
||||||
color10 #A3BE8C
|
|
||||||
|
|
||||||
# Yellow
|
# -------------------------------------------------------
|
||||||
color3 #EBCB8B
|
# ------------------ Nord Color Scheme ------------------
|
||||||
color11 #EBCB8B
|
# -------------------------------------------------------
|
||||||
|
#
|
||||||
# Blue
|
# foreground #D8DEE9
|
||||||
color4 #81A1C1
|
# background #2E3440
|
||||||
color12 #81A1C1
|
# selection_foreground #000000
|
||||||
|
# selection_background #FFFACD
|
||||||
# Magenta
|
# url_color #0087BD
|
||||||
color5 #B48EAD
|
# cursor #81A1C1
|
||||||
color13 #B48EAD
|
#
|
||||||
|
# # Black
|
||||||
# Cyan
|
# color0 #3B4252
|
||||||
color6 #88C0D0
|
# color8 #4C566A
|
||||||
color14 #8FBCBB
|
#
|
||||||
|
# # Red
|
||||||
# White
|
# color1 #BF616A
|
||||||
color7 #E5E9F0
|
# color9 #BF616A
|
||||||
color15 #ECEFF4
|
#
|
||||||
|
# # Green
|
||||||
|
# color2 #A3BE8C
|
||||||
|
# color10 #A3BE8C
|
||||||
|
#
|
||||||
|
# # Yellow
|
||||||
|
# color3 #EBCB8B
|
||||||
|
# color11 #EBCB8B
|
||||||
|
#
|
||||||
|
# # Blue
|
||||||
|
# color4 #81A1C1
|
||||||
|
# color12 #81A1C1
|
||||||
|
#
|
||||||
|
# # Magenta
|
||||||
|
# color5 #B48EAD
|
||||||
|
# color13 #B48EAD
|
||||||
|
#
|
||||||
|
# # Cyan
|
||||||
|
# color6 #88C0D0
|
||||||
|
# color14 #8FBCBB
|
||||||
|
#
|
||||||
|
# # White
|
||||||
|
# color7 #E5E9F0
|
||||||
|
# color15 #ECEFF4
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
-- Set Theme
|
-- Set Theme
|
||||||
vim.g.nord_borders = true
|
-- vim.g.nord_borders = true
|
||||||
vim.g.nord_contrast = true
|
-- vim.g.nord_contrast = true
|
||||||
vim.cmd('colorscheme nord')
|
-- vim.cmd('colorscheme nord')
|
||||||
|
vim.cmd('colorscheme melange')
|
||||||
|
|
||||||
-- Set Leader
|
-- Set Leader
|
||||||
vim.keymap.set("n", "<Space>", "<Nop>", {silent = true})
|
vim.keymap.set("n", "<Space>", "<Nop>", {silent = true})
|
||||||
|
20
nvim/config/lua/dap-config.lua
Normal file
20
nvim/config/lua/dap-config.lua
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
local dap = require("dap")
|
||||||
|
local dapui = require("dapui")
|
||||||
|
local dapgo = require("dap-go")
|
||||||
|
|
||||||
|
dapui.setup()
|
||||||
|
dapgo.setup()
|
||||||
|
|
||||||
|
-- Auto Open UI
|
||||||
|
dap.listeners.before.attach.dapui_config = function() dapui.open() end
|
||||||
|
dap.listeners.before.launch.dapui_config = function() dapui.open() end
|
||||||
|
dap.listeners.before.event_terminated.dapui_config =
|
||||||
|
function() dapui.close() end
|
||||||
|
dap.listeners.before.event_exited.dapui_config = function() dapui.close() end
|
||||||
|
|
||||||
|
-- Leader Keys
|
||||||
|
local opts = {noremap = true, silent = true}
|
||||||
|
vim.keymap.set('n', '<leader>db', dap.toggle_breakpoint, opts)
|
||||||
|
vim.keymap.set('n', '<leader>du', dapui.toggle, opts)
|
||||||
|
vim.keymap.set('n', '<leader>dc', dap.continue, opts)
|
||||||
|
vim.keymap.set('n', '<leader>dt', dapgo.debug_test, opts)
|
@ -1,3 +1,3 @@
|
|||||||
vim.keymap.set('n', '<leader>do', '<cmd>DiffviewOpen<CR>')
|
vim.keymap.set('n', '<leader>go', '<cmd>DiffviewOpen<CR>')
|
||||||
vim.keymap.set('n', '<leader>dc', '<cmd>DiffviewClose<CR>')
|
vim.keymap.set('n', '<leader>gc', '<cmd>DiffviewClose<CR>')
|
||||||
vim.keymap.set('n', '<leader>dh', '<cmd>DiffviewFileHistory<CR>')
|
vim.keymap.set('n', '<leader>gh', '<cmd>DiffviewFileHistory<CR>')
|
||||||
|
@ -3,6 +3,7 @@ require('aerial-config')
|
|||||||
require('autopairs-config')
|
require('autopairs-config')
|
||||||
require('cmp-config')
|
require('cmp-config')
|
||||||
require('comment-config')
|
require('comment-config')
|
||||||
|
require('dap-config')
|
||||||
require('diffview-config')
|
require('diffview-config')
|
||||||
require('leap-config')
|
require('leap-config')
|
||||||
require('lsp-config')
|
require('lsp-config')
|
||||||
|
@ -69,7 +69,8 @@ nvim_lsp.tsserver.setup {
|
|||||||
["textDocument/publishDiagnostics"] = function() end
|
["textDocument/publishDiagnostics"] = function() end
|
||||||
},
|
},
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
cmd = {nix_vars.tsserver, "--stdio", "--tsserver-path", nix_vars.tslib}
|
cmd = {nix_vars.tsserver, "--stdio"}
|
||||||
|
-- cmd = {nix_vars.tsserver, "--stdio", "--tsserver-path", nix_vars.tslib}
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Javascript / Typescript LSP Configuration
|
-- Javascript / Typescript LSP Configuration
|
||||||
@ -93,13 +94,28 @@ nvim_lsp.gopls.setup {
|
|||||||
------------------------------------------------------
|
------------------------------------------------------
|
||||||
local null_ls = require("null-ls")
|
local null_ls = require("null-ls")
|
||||||
|
|
||||||
|
local eslint_root_files = {
|
||||||
|
".eslintrc", ".eslintrc.js", ".eslintrc.json", ".eslintrc.yml"
|
||||||
|
}
|
||||||
|
local prettier_root_files = {
|
||||||
|
".prettierrc", ".prettierrc.js", ".prettierrc.json"
|
||||||
|
}
|
||||||
|
|
||||||
null_ls.setup({
|
null_ls.setup({
|
||||||
sources = {
|
sources = {
|
||||||
|
null_ls.builtins.formatting.prettier.with({
|
||||||
|
condition = function(utils)
|
||||||
|
return not utils.has_file(".eslintrc.yml")
|
||||||
|
end
|
||||||
|
}), null_ls.builtins.formatting.eslint.with({
|
||||||
|
condition = function(utils)
|
||||||
|
return utils.has_file(".eslintrc.yml")
|
||||||
|
end
|
||||||
|
}), null_ls.builtins.formatting.djlint.with({filetypes = {"template"}}),
|
||||||
null_ls.builtins.completion.spell,
|
null_ls.builtins.completion.spell,
|
||||||
null_ls.builtins.formatting.nixpkgs_fmt,
|
null_ls.builtins.formatting.nixpkgs_fmt,
|
||||||
null_ls.builtins.formatting.lua_format,
|
null_ls.builtins.formatting.lua_format,
|
||||||
null_ls.builtins.formatting.prettier.with({filetypes = {"svelte"}}),
|
null_ls.builtins.formatting.gofmt,
|
||||||
null_ls.builtins.formatting.prettier, null_ls.builtins.formatting.gofmt,
|
|
||||||
null_ls.builtins.diagnostics.sqlfluff,
|
null_ls.builtins.diagnostics.sqlfluff,
|
||||||
null_ls.builtins.formatting.sqlfluff
|
null_ls.builtins.formatting.sqlfluff
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
require('lualine').setup({
|
require('lualine').setup({
|
||||||
options = {
|
options = {
|
||||||
theme = "nord"
|
theme = "gruvbox_dark"
|
||||||
|
-- theme = "nord"
|
||||||
-- theme = "OceanicNext",
|
-- theme = "OceanicNext",
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -15,6 +15,13 @@ wk.register({
|
|||||||
e = {"Open Diagnostic Float"}
|
e = {"Open Diagnostic Float"}
|
||||||
},
|
},
|
||||||
d = {
|
d = {
|
||||||
|
name = "Debug",
|
||||||
|
b = {"Toggle Breakpoint"},
|
||||||
|
u = {"Toggle UI"},
|
||||||
|
c = {"Continue"},
|
||||||
|
t = {"Run Test"}
|
||||||
|
},
|
||||||
|
g = {
|
||||||
name = "DiffView",
|
name = "DiffView",
|
||||||
o = {"<cmd>DiffviewOpen<cr>", "Open Diff"},
|
o = {"<cmd>DiffviewOpen<cr>", "Open Diff"},
|
||||||
c = {"<cmd>DiffviewClose<cr>", "Close Diff"},
|
c = {"<cmd>DiffviewClose<cr>", "Close Diff"},
|
||||||
|
@ -48,15 +48,24 @@ in
|
|||||||
# ------------------
|
# ------------------
|
||||||
lualine-nvim # Bottom Line
|
lualine-nvim # Bottom Line
|
||||||
noice-nvim # UI Tweaks
|
noice-nvim # UI Tweaks
|
||||||
|
# nord-nvim # Theme
|
||||||
|
melange-nvim # Theme
|
||||||
nvim-notify # Noice Dependency
|
nvim-notify # Noice Dependency
|
||||||
nord-nvim # Theme
|
|
||||||
nvim-web-devicons # Dev Icons
|
nvim-web-devicons # Dev Icons
|
||||||
|
|
||||||
# ------------------
|
# ------------------
|
||||||
# --- Treesitter ---
|
# --- Treesitter ---
|
||||||
# ------------------
|
# ------------------
|
||||||
|
nvim-treesitter-context
|
||||||
nvim-treesitter.withAllGrammars
|
nvim-treesitter.withAllGrammars
|
||||||
|
|
||||||
|
# ------------------
|
||||||
|
# ------ DAP -------
|
||||||
|
# ------------------
|
||||||
|
nvim-dap
|
||||||
|
nvim-dap-go
|
||||||
|
nvim-dap-ui
|
||||||
|
|
||||||
# ------------------
|
# ------------------
|
||||||
# ----- Silicon ----
|
# ----- Silicon ----
|
||||||
# ------------------
|
# ------------------
|
||||||
@ -77,19 +86,21 @@ in
|
|||||||
|
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
# Telescope Dependencies
|
# Telescope Dependencies
|
||||||
ripgrep
|
|
||||||
fd
|
fd
|
||||||
|
ripgrep
|
||||||
tree-sitter
|
tree-sitter
|
||||||
|
|
||||||
# LSP Dependencies
|
# LSP Dependencies
|
||||||
|
go
|
||||||
|
gopls
|
||||||
|
nodePackages.eslint
|
||||||
nodePackages.pyright
|
nodePackages.pyright
|
||||||
nodePackages.typescript
|
nodePackages.typescript
|
||||||
nodePackages.typescript-language-server
|
nodePackages.typescript-language-server
|
||||||
nodePackages.vscode-langservers-extracted
|
nodePackages.vscode-langservers-extracted
|
||||||
gopls
|
|
||||||
go
|
|
||||||
|
|
||||||
# Formatters
|
# Formatters
|
||||||
|
djlint
|
||||||
luaformatter
|
luaformatter
|
||||||
nixpkgs-fmt
|
nixpkgs-fmt
|
||||||
nodePackages.prettier
|
nodePackages.prettier
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
git-mode = "compact";
|
git-mode = "compact";
|
||||||
|
theme = "gruvbox";
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
"host"
|
"host"
|
||||||
|
Loading…
Reference in New Issue
Block a user