1
Fork 0

Filetype stuff

This commit is contained in:
Hadeed 2023-08-31 05:37:44 +05:00
parent 02139ebd70
commit c1e2bb675d
5 changed files with 25 additions and 21 deletions

View file

@ -1,2 +0,0 @@
vim.keymap.set("i", "<C-CR>", "<CMD>x<CR>", { buffer=true })
vim.cmd('startinsert')

View file

@ -0,0 +1,2 @@
inoremap <buffer> <C-CR> <CMD>x<CR>
startinsert

View file

@ -1,3 +0,0 @@
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2

View file

@ -1,5 +1,6 @@
require("options")
require("keymaps")
require("filetypes")
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
@ -14,19 +15,3 @@ if not vim.loop.fs_stat(lazypath) then
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins")
vim.filetype.add({
filename = {
["user-dirs.dirs"] = "conf",
["gruvbox.conf"] = "kitty",
["keys.conf"] = "kitty",
["kitty.conf"] = "kitty",
["dot-zshenv"] = "zsh",
["dot-zshrc"] = "zsh"
},
pattern = {
[".*/git/config"] = "gitconfig"
}
})

22
nvim/lua/filetypes.lua Normal file
View file

@ -0,0 +1,22 @@
vim.filetype.add({
filename = {
["user-dirs.dirs"] = "conf",
["gruvbox.conf"] = "kitty",
["keys.conf"] = "kitty",
["kitty.conf"] = "kitty",
["ssh.conf"] = "kitty",
["dot-zshenv"] = "zsh",
["dot-zshrc"] = "zsh"
},
pattern = {
[".*/git/config"] = "gitconfig"
}
})
vim.api.nvim_create_autocmd('Filetype', {
group = vim.api.nvim_create_augroup('setIndent', { clear = true }),
pattern = { "lua", "html" },
command = 'setlocal tabstop=2 softtabstop=2 shiftwidth=2'
})