Skip to content

Commit

Permalink
more work on slices for C
Browse files Browse the repository at this point in the history
unfortunately C does not allow checks for string literals via macros
* compiler builtins exist like __builtin_constant_p for gcc and clang,
but they are not portable
  • Loading branch information
matu3ba committed Dec 9, 2024
1 parent a68825a commit 10fde99
Show file tree
Hide file tree
Showing 10 changed files with 666 additions and 100 deletions.
8 changes: 7 additions & 1 deletion .config/nvim/lua/my_fmt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ local has_conform, conform = pcall(require, 'conform')
if not has_conform then return end
-- local util = conform.util

---ruff.toml
-- line-length = 100
-- [format]
-- quote-style = "single"
-- indent-style = "space"

-- ruff_format: no cmd for combined linting and fmt yet https://github.com/astral-sh/ruff/issues/8232
-- stylua: cargo install stylua --features lua52
local fmts_by_ft = {
Expand All @@ -17,7 +23,7 @@ local fmts_by_ft = {
c = { 'clang-format' }, -- // clang-format off|on
cpp = { 'clang-format' }, -- // clang-format off|on
lua = { 'stylua' }, -- stylua: ignore start|end
python = { 'ruff_format' }, -- # fmt: off|on, # fmt: skip
-- python = { 'ruff_format' }, -- # fmt: off|on, # fmt: skip
rust = { 'rustfmt', lsp_format = 'prefer' },
sh = { 'shfmt' },
shtml = { 'superhtml' },
Expand Down
1 change: 1 addition & 0 deletions .config/nvim/lua/my_plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ return {
-- surround with brackets, quotes, call etc
-- adjust inner padding srn{{ }}: { a ={ b = {c} } }
-- sf/F to find left/right surrounding, sh to highlight left/right surrounding
-- selection + sa/sd/sr + key also works!
{ 'echasnovski/mini.surround', config = function() require('mini.surround').setup() end },

-- idea gm,gx,gsi conflicts
Expand Down
Loading

0 comments on commit 10fde99

Please sign in to comment.