first commit

This commit is contained in:
sam 2024-10-21 23:52:27 +13:00
commit fe208c317b
2 changed files with 54 additions and 0 deletions

37
nvim/init.lua Normal file
View file

@ -0,0 +1,37 @@
vim.opt.number = true
vim.opt.relativenumber = true
vim.cmd 'colorscheme habamax'
vim.opt.expandtab = true
vim.opt.tabstop = 8
vim.opt.softtabstop = 0
vim.opt.shiftwidth = 4
vim.opt.smarttab = true
vim.opt.autoindent = true
vim.opt.mouse = 'a'
vim.o.completeopt = "menuone,noinsert,noselect,preview"
vim.api.nvim_create_autocmd('FileType', {
pattern = 'c',
callback = function(args)
vim.lsp.start({
name = 'clangd',
cmd = {'clangd'},
root_dir = vim.fn.expand("."),
})
end,
})
vim.api.nvim_create_autocmd({"InsertCharPre"}, {
callback = function()
vim.lsp.buf.completion()
end
})
vim.api.nvim_create_autocmd({"CursorMovedI"}, {
callback = function()
vim.lsp.buf.hover()
end
})

17
vim/.vimrc Normal file
View file

@ -0,0 +1,17 @@
set tabstop=4 expandtab
set shiftwidth=4
set softtabstop=4
set autoindent
set cindent
set mouse=a
set number
set relativenumber
syntax on
colorscheme habamax
filetype plugin on
setlocal shortmess+=c
set tags=./tags,tags;
set completeopt=menu,menuone,noinsert,popup
autocmd InsertCharPre * if pumvisible() == 0 && filereadable(expand(split(&tags, ',')[0])) && &filetype == 'c' | call feedkeys("\<C-x>\<C-o>") | endif