Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
SingularisArt committed Aug 23, 2023
1 parent 16abe7e commit df79486
Show file tree
Hide file tree
Showing 14 changed files with 181 additions and 33 deletions.
4 changes: 2 additions & 2 deletions aspects/dotfiles/files/.home/.zshenv
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export SSB_HOME="$XDG_DATA_HOME/zoom"
export GTK_THEME="oomox-xresources-reverse"
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
export WGETRC="$XDG_CONFIG_HOME/wgetrc"
export XAUTHORITY="$HOME/.Xauthority"
#export XAUTHORITY="$XDG_CONFIG_HOME/Xauthority"
# export XAUTHORITY="$HOME/.Xauthority"
export XAUTHORITY="$XDG_CONFIG_HOME/Xauthority"
export PASSWORD_STORE_DIR="$XDG_CONFIG_HOME/password-store"
export MBSYNCRC="$XDG_CONFIG_HOME/mbsync/mbsyncrc"
export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch/config"
Expand Down
Binary file modified aspects/dotfiles/files/.local/share/autojump/autojump.txt
Binary file not shown.
Binary file modified aspects/dotfiles/files/.local/share/autojump/autojump.txt.bak
Binary file not shown.
Binary file modified aspects/dotfiles/files/.local/share/bookmarks/current
Binary file not shown.
Binary file modified aspects/dotfiles/files/.local/share/bookmarks/websites
Binary file not shown.
Binary file modified aspects/dotfiles/files/.local/share/newsboat/cache.db
Binary file not shown.
Binary file modified aspects/dotfiles/files/.local/share/zathura/history
Binary file not shown.
46 changes: 46 additions & 0 deletions aspects/nvim/files/.config/nvim/ftplugin/dart.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
local which_key = require("which-key")
local options = require("config.global").which_key_vars.options

options = vim.tbl_deep_extend("force", {
filetype = "dart",
buffer = vim.api.nvim_get_current_buf(),
}, options)

which_key.register({
["L"] = {
name = "Language",
p = { "<CMD>FlutterRun<CR>", "Run project" },
d = { "<CMD>FlutterDevices<CR>", "List connected devices" },
e = { "<CMD>FlutterEmulators<CR>", "List of emulators" },
q = { "<CMD>FlutterQuit<CR>", "End running session" },
D = { "<CMD>FlutterDetach<CR>", "End running session locally" },
o = { "<CMD>FlutterOutlineToggle<CR>", "Toggle outline window" },
t = { "<CMD>FlutterDevTools<CR>", "Start Dart Dev Tools server" },
a = { "<CMD>FlutterDevToolsActivate<CR>", "Start Dart Dev Tools server" },
P = { "<CMD>FlutterCopyProfilerUrl<CR>", "Copy profiler url to system clipboard" },
l = { "<CMD>FlutterLspRestart<CR>", "Restart LSP" },
s = { "<CMD>FlutterSuper<CR>", "Go to super class" },
r = { "<CMD>FlutterRename<CR>", "Rename and updates imports" },
},
}, options)

local dap = require("dap")
local mason_path = vim.fn.glob(vim.fn.stdpath("data")) .. "/mason/"
local dart_debug_adapter_exec_path = mason_path .. "packages/dart-debug-adapter"

dap.adapters.dart = {
type = "executable",
command = "node",
args = {dart_debug_adapter_exec_path .. "/extension/out/dist/debug.js", "flutter"}
}
dap.configurations.dart = {
{
type = "dart",
request = "launch",
name = "Launch flutter",
dartSdkPath = os.getenv("HOME") .. "/.config/flutter/bin/cache/dart-sdk/",
flutterSdkPath = os.getenv("HOME") .. "/.config/flutter",
program = "${workspaceFolder}/lib/main.dart",
cwd = "${workspaceFolder}",
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ return function(use)
"nvim-neotest/neotest-plenary",
"nvim-neotest/neotest-vim-test",
"haydenmeade/neotest-jest",
{
"sidlatau/neotest-dart", ft = { "dart" },
config = function()
require("neotest-dart") { command = "flutter" }
end
},
},
})

Expand Down
75 changes: 73 additions & 2 deletions aspects/nvim/files/.config/nvim/lua/modules/lsp/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ function config.navigator()
cssmodules_ls = { filetypes = { "css" } },
dartls = { filetypes = { "dart" } },
solargraph = { filetypes = { "ruby" } },
tsserver = require("modules.lsp.settings.tsserver"),
-- tsserver = require("modules.lsp.settings.tsserver"),
yamlls = require("modules.lsp.settings.yamlls"),
sqlls = require("modules.lsp.settings.sqlls"),
cssls = { filetypes = { "css" } },
html = require("modules.lsp.settings.html"),
texlab = require("modules.lsp.settings.texlab"),
bashls = { filetypes = { "bash", "sh" } },
clangd = require("modules.lsp.settings.clangd"),
-- clangd = require("modules.lsp.settings.clangd"),
tailwindcss = {
filetypes = {
"html",
Expand Down Expand Up @@ -178,4 +178,75 @@ function config.glance()
})
end

function config.clangd_extensions()
local setup = {
server = {
root_dir = function(...)
return require("lspconfig.util").root_pattern("compile_commands.json", "compile_flags.txt", "configure.ac", ".git")(...)
end,
capabilities = {
offsetEncoding = { "utf-16" },
},
cmd = {
"clangd",
"--background-index",
"--clang-tidy",
"--header-insertion=iwyu",
"--completion-style=detailed",
"--function-arg-placeholders",
"--fallback-style=llvm",
},
init_options = {
usePlaceholders = true,
completeUnimported = true,
clangdFileStatus = true,
},
},
extensions = {
inlay_hints = {
inline = true,
},
},
}

require("clangd_extensions").setup {
server = setup.server,
extensions = setup.extensions,
}
end

function config.flutter_tools()
local line = { "", "", "", "", "", "", "", "" }

require("flutter-tools").setup({
ui = { border = line },
debugger = {
enabled = false,
run_via_dap = false,
exception_breakpoints = {},
},
outline = { auto_open = false },
decorations = {
statusline = { device = true, app_version = true },
},
widget_guides = { enabled = true, debug = false },
dev_log = { enabled = true, open_cmd = "tabedit" },
lsp = {
color = {
enabled = false,
-- enabled = true,
-- background = true,
-- virtual_text = false,
},
settings = {
showTodos = true,
renameFilesWithClasses = "always",
updateImportsOnRename = true,
completeFunctionCalls = true,
lineLength = 100,
},
},
})
end

return config
38 changes: 25 additions & 13 deletions aspects/nvim/files/.config/nvim/lua/modules/lsp/handlers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ lsp.on_attach = function(client, bufnr)

if client.name == "sqls" then
require("sqls").on_attach(client, bufnr)
elseif client.name == "gopls" then
if not client.server_capabilities.semanticTokensProvider then
local semantic = client.config.capabilities.textDocument.semanticTokens
client.server_capabilities.semanticTokensProvider = {
full = true,
legend = {
tokenTypes = semantic.tokenTypes,
tokenModifiers = semantic.tokenModifiers,
},
range = true,
}
end
end

if servers_that_dont_work_with_navic[client.name] ~= nil then
Expand All @@ -100,19 +112,19 @@ lsp.on_attach = function(client, bufnr)

require("colorizer").attach_to_buffer(bufnr)

-- if client.resolved_capabilities.code_lens then
-- local codelens = vim.api.nvim_create_augroup(
-- "LSPCodeLens",
-- { clear = true }
-- )
-- vim.api.nvim_create_autocmd({ "BufEnter", "InsertLeave", "CursorHold" }, {
-- group = codelens,
-- callback = function()
-- vim.lsp.codelens.refresh()
-- end,
-- buffer = bufnr,
-- })
-- end
if client.resolved_capabilities.code_lens then
local codelens = vim.api.nvim_create_augroup(
"LSPCodeLens",
{ clear = true }
)
vim.api.nvim_create_autocmd({ "BufEnter", "InsertLeave", "CursorHold" }, {
group = codelens,
callback = function()
vim.lsp.codelens.refresh()
end,
buffer = bufnr,
})
end
end

return lsp
13 changes: 11 additions & 2 deletions aspects/nvim/files/.config/nvim/lua/modules/lsp/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,17 @@ return function(use)
build = ":lua require('go.install').update_all_sync()"
})

use({ "akinsho/flutter-tools.nvim", ft = { "dart" } })
use({ "p00f/clangd_extensions.nvim", ft = { "cpp", "c" } })
use({
"akinsho/flutter-tools.nvim",
config = conf.flutter_tools,
ft = { "dart" },
})

use({
"p00f/clangd_extensions.nvim",
config = conf.clangd_extensions,
ft = { "cpp", "c" },
})

use({
"hbarral/vim-dadbod",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
-- local util = require("lspconfig.util")

return {
-- root_dir = util.root_pattern("go.mod", "go.work", ".git"),
filtypes = { "go", "gomod", "gowork", "gotmpl" },
settings = {
gopls = {
staticcheck = true,
semanticTokens = true,
completeUnimported = true,
usePlaceholders = true,
analyses = {
unusedparams = true,
},
Expand All @@ -21,6 +14,9 @@ return {
parameterNames = true,
rangeVariableTypes = true,
},
staticcheck = true,
semanticTokens = true,
},
},
golangci_lint_ls = {},
}
22 changes: 15 additions & 7 deletions aspects/nvim/files/.config/nvim/lua/modules/ui/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ function config.zen_mode()
twilight = { enabled = false },
},
on_open = function()
require("lsp-inlayhints").toggle()
local status, inlayhints = pcall(require, "lsp-inlayhints")
if status then
inlayhints.toggle()
end

vim.g.cmp_active = false
vim.cmd("LspStop")
local status_ok, _ = pcall(vim.api.nvim_set_option_value, "winbar", nil, { scope = "local" })
Expand All @@ -35,7 +39,11 @@ function config.zen_mode()
end
end,
on_close = function()
require("lsp-inlayhints").toggle()
local status, inlayhints = pcall(require, "lsp-inlayhints")
if status then
inlayhints.toggle()
end

vim.g.cmp_active = true
vim.cmd("LspStart")
end,
Expand All @@ -45,11 +53,11 @@ end
function config.hlslens()
require("hlslens").setup()
vim.cmd([[
hi default link HlSearchNear IncSearch
hi default link HlSearchLens WildMenu
hi default link HlSearchLensNear IncSearch
hi default link HlSearchFloat IncSearch
]])
hi default link HlSearchNear IncSearch
hi default link HlSearchLens WildMenu
hi default link HlSearchLensNear IncSearch
hi default link HlSearchFloat IncSearch
]])

local kopts = { noremap = true, silent = true }

Expand Down

0 comments on commit df79486

Please sign in to comment.