New configs

This commit is contained in:
2024-05-18 23:46:28 +03:00
parent 7f13ec22ea
commit 5a3ae61e8b
11 changed files with 235 additions and 58 deletions

View File

@@ -9,6 +9,8 @@
"hydra.nvim": { "branch": "master", "commit": "55de54543d673824435930ecf533256eea2e565b" },
"kanagawa.nvim": { "branch": "master", "commit": "c19b9023842697ec92caf72cd3599f7dd7be4456" },
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
"lazygit.nvim": { "branch": "main", "commit": "ad3e1ea592f9d13e86e0d4e850224d9d78069508" },
"lsp-inlayhints.nvim": { "branch": "main", "commit": "d981f65c9ae0b6062176f0accb9c151daeda6f16" },
"lsp-zero.nvim": { "branch": "v1.x", "commit": "aa36afcf7a59fbd98008c9a434593c423d3d649a" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "0989bdf4fdf7b5aa4c74131d7ffccc3f399ac788" },
"mason.nvim": { "branch": "main", "commit": "e110bc3be1a7309617cecd77bfe4bf86ba1b8134" },
@@ -17,5 +19,6 @@
"nvim-lspconfig": { "branch": "master", "commit": "e47ccfae775f0d572ef0f3a7d245f043b259dafc" },
"nvim-tree.lua": { "branch": "master", "commit": "b8c3a23e76f861d5f0ff3f6714b9b56388984d0b" },
"nvim-treesitter": { "branch": "master", "commit": "8cd2b230174efbf7b5d9f49fe2f90bda6b5eb16e" },
"nvim-web-devicons": { "branch": "master", "commit": "db0c864375c198cacc171ff373e76bfce2a85045" }
"nvim-web-devicons": { "branch": "master", "commit": "db0c864375c198cacc171ff373e76bfce2a85045" },
"plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }
}

View File

@@ -0,0 +1,19 @@
return {
"kdheepak/lazygit.nvim",
cmd = {
"LazyGit",
"LazyGitConfig",
"LazyGitCurrentFile",
"LazyGitFilter",
"LazyGitFilterCurrentFile",
},
-- optional for floating window border decoration
dependencies = {
"nvim-lua/plenary.nvim",
},
-- setting the keybinding for LazyGit with 'keys' is recommended in
-- order to load the plugin when the command is run for the first time
keys = {
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" }
}
}

View File

@@ -6,6 +6,7 @@ return {
{'neovim/nvim-lspconfig'}, -- Required
{'williamboman/mason.nvim'}, -- Optional
{'williamboman/mason-lspconfig.nvim'}, -- Optional
{'lvimuser/lsp-inlayhints.nvim'},
-- Autocompletion
{'hrsh7th/nvim-cmp'}, -- Required
@@ -21,18 +22,29 @@ return {
},
init = function()
local lsp_zero = require('lsp-zero')
local ih = require('lsp-inlayhints')
ih.setup()
lsp_zero.on_attach(function(client, bufnr)
-- see :help lsp-zero-keybindings
-- to learn the available actions
lsp_zero.default_keymaps({buffer = bufnr})
-- see :help lsp-zero-keybindings
-- to learn the available actions
lsp_zero.default_keymaps({buffer = bufnr})
-- ih.on_attach(client, bufnr)
end)
require('mason').setup({})
require('mason-lspconfig').setup({
ensure_installed = {},
handlers = {
lsp_zero.default_setup,
},
ensure_installed = {},
handlers = {
function(server_name)
require('lspconfig')[server_name].setup({
on_attach = function(client, bufnr)
ih.on_attach(client, bufnr)
end,
})
end,
},
})
-- require('lspconfig').clangd.setup({})
end
};

View File

@@ -13,7 +13,7 @@ return {
},
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
sync_install = true,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
@@ -35,7 +35,7 @@ return {
disable = { },
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
local max_filesize = 1024 * 1024 * 1-- 1 MB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
@@ -46,7 +46,7 @@ return {
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
additional_vim_regex_highlighting = true,
},
}
end

View File

@@ -0,0 +1,38 @@
" Vim syntax file
" Language: MClang
" Maintainer: MCorange
" Maintainer: xomf
if exists("b:current_syntax")
finish
endif
syn keyword MCLangKeywords contained memory fn const in inline include assert with returns typedef structdef if else elif end done then while do
syn keyword MCLangInstructions contained divmod div mod _dbg_print eq lt gt le ge ne shr shl bor band not dup swap drop over rot syscall0 syscall1 syscall2 syscall3 syscall4 syscall5 syscall6
syn keyword MCLangTypes contained void u8 u16 u32 u64 ptr char
syn keyword MCLangBool contained true false
syn keyword MCLangConst contained NULL
" i8 i16 i32 i64 f32 f64
syn match MCLangComment '//.*'
syn match MCLangIdentifier '(?<=^|\\s)([a-z|A-Z|_|\\-][0-9|a-z|A-Z|_|\\-]+\\([a-z|A-Z|_|\\-][0-9|a-z|A-Z|_|\\-]+\\)|[a-z|A-Z|_|\\-][0-9|a-z|A-Z|_|\\-]+)(?:\\s|$)'
syn match MCLangNumber '\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)\\b(?!\\$)'
syn region MCLangString start='"' end='"' contained
syn region MCLangChar start='\'' end='\'' contained
let b:current_syntax = "MCLang"
hi def link MCLangComment Comment
hi def link MCLangTypes Type
hi def link MCLangString Constant
hi def link MCLangChar Character
hi def link MCLangNumber Constant
hi def link MCLangConst Constant
hi def link MCLangBool Boolean
hi def link MCLangInstructions Operator
hi def link MCLangKeywords Keyword
hi def link MCLangIdentifier Identifier

View File

@@ -0,0 +1,49 @@
include "std.mcl"
structdef Uwu do
owo do u64 end
twt do u64 end
done
structdef Foo do
buz do u64 end
uwu do Uwu end
done
memory s_foo Foo end
//? Comments :3
// extern fn a with void returns void then done
// inline fn b with void returns void then done
// export fn c with void returns void then done
// fn putd with int returns void then drop done
fn main with void returns void then
s_foo.uwu.twt 69 write64
s_foo.uwu.twt read64 _dbg_print
// 1 2 add
// 69 _dbg_print
// "Hewo\n" puts
// if 3 4 eq do
// "omg what impossible!\n"
// else if 1 1 eq do
// "whaaaaaaaaa\n"
// else
// "finally, some good soup\n"
// done
// puts
// 10
// while dup 0 gt do
// "uwu " puts
// dup _dbg_print
// 1 sub
// done
done