From c1e2bb675dd7073e63be1ace14c54a092e4a6322 Mon Sep 17 00:00:00 2001 From: Hadeed Ahmad Date: Thu, 31 Aug 2023 05:37:44 +0500 Subject: [PATCH] Filetype stuff --- nvim/ftplugin/gitcommit.lua | 2 -- nvim/ftplugin/gitcommit.vim | 2 ++ nvim/ftplugin/lua.lua | 3 --- nvim/init.lua | 17 +---------------- nvim/lua/filetypes.lua | 22 ++++++++++++++++++++++ 5 files changed, 25 insertions(+), 21 deletions(-) delete mode 100644 nvim/ftplugin/gitcommit.lua create mode 100644 nvim/ftplugin/gitcommit.vim delete mode 100644 nvim/ftplugin/lua.lua create mode 100644 nvim/lua/filetypes.lua diff --git a/nvim/ftplugin/gitcommit.lua b/nvim/ftplugin/gitcommit.lua deleted file mode 100644 index 3642f44..0000000 --- a/nvim/ftplugin/gitcommit.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.keymap.set("i", "", "x", { buffer=true }) -vim.cmd('startinsert') diff --git a/nvim/ftplugin/gitcommit.vim b/nvim/ftplugin/gitcommit.vim new file mode 100644 index 0000000..b815bee --- /dev/null +++ b/nvim/ftplugin/gitcommit.vim @@ -0,0 +1,2 @@ +inoremap x +startinsert diff --git a/nvim/ftplugin/lua.lua b/nvim/ftplugin/lua.lua deleted file mode 100644 index 3da2b37..0000000 --- a/nvim/ftplugin/lua.lua +++ /dev/null @@ -1,3 +0,0 @@ -vim.opt.tabstop = 2 -vim.opt.softtabstop = 2 -vim.opt.shiftwidth = 2 diff --git a/nvim/init.lua b/nvim/init.lua index 64b1c44..dcc5c8c 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -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" - } -}) diff --git a/nvim/lua/filetypes.lua b/nvim/lua/filetypes.lua new file mode 100644 index 0000000..d5817ed --- /dev/null +++ b/nvim/lua/filetypes.lua @@ -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' +})