diff --git a/symlinks/config/nvim/lua/plugin/projectionist.lua b/symlinks/config/nvim/lua/plugin/projectionist.lua index b41a73b..0d00704 100644 --- a/symlinks/config/nvim/lua/plugin/projectionist.lua +++ b/symlinks/config/nvim/lua/plugin/projectionist.lua @@ -1,3 +1,4 @@ +local log = require "vim.lsp.log" local vim_readme_template = { "# Name", "", @@ -289,11 +290,47 @@ local csharp_project_config = { } } +local function c_project_config(source_extension, header_extension) + return { + ["*"] = { + start = "make run" + }, + ["src/*." .. source_extension] = { + type = "source", + alternate = { + "src/{}." .. header_extension, + "test/{}." .. source_extension, + "include/{project|basename}/{}." .. header_extension, + } + }, + ["test/*." .. source_extension] = { + type = "test", + alternate = { + "src/{}." .. header_extension + } + }, + ["src/*." .. header_extension] = { + type = "header", + alternate = { + "src/{}." .. source_extension + } + }, + ["include/{project|basename}/*." .. header_extension] = { + type = "header", + alternate = { + "src/{}." .. header_extension + } + } + } +end + vim.g.projectionist_heuristics = { ["pubspec.yaml"] = flutter_config, ["requirements.txt|pyproject.toml"] = python_config, ["*.sln"] = dotnet_solution_config, ["*.csproj"] = csharp_project_config, ["plugin/|autoload/"] = vim_plugin_config, + ["src/*.cpp|test/*.cpp"] = c_project_config("cpp", "hpp"), + ["src/*.c|test/*.c"] = c_project_config("c", "h"), ["lua/"] = lua_vim_plugin_config } diff --git a/symlinks/config/nvim/plugin/ale.vim b/symlinks/config/nvim/plugin/ale.vim index 0052b06..ed31a13 100644 --- a/symlinks/config/nvim/plugin/ale.vim +++ b/symlinks/config/nvim/plugin/ale.vim @@ -12,6 +12,7 @@ let g:ale_linters.python = ['flake8'] let g:ale_linters.kotlin = ['ktlint'] let g:ale_linters.clojure = [] let g:ale_linters.cs = ['OmniSharp'] +let g:ale_linters.cpp = ['clangd'] " ALE Fixers configuration let g:ale_fixers = {} @@ -20,6 +21,7 @@ let g:ale_fixers.python = ['autopep8', 'isort'] let g:ale_fixers.dart = ['dartfmt'] let g:ale_fixers.lua = ['luafmt'] let g:ale_fixers.go = ['gofmt'] +let g:ale_fixers.cpp = ['clang-format'] " Warnings navigation nmap [W (ale_first) diff --git a/symlinks/gitignore b/symlinks/gitignore index 95d0950..ad99632 100644 --- a/symlinks/gitignore +++ b/symlinks/gitignore @@ -73,3 +73,5 @@ erl_crash.dump # Python pyrightconfig.json + +**/.lsp/sqlite.db