diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..f965948 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "pack/vendor/start/vim-wakatime"] + path = pack/vendor/start/vim-wakatime + url = https://github.com/wakatime/vim-wakatime.git diff --git a/README.md b/README.md index b9d4dcf..5f455ca 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ # Neovim Config -## Requirements -* [ripgrep](https://github.com/BurntSushi/ripgrep) -* [fd](https://github.com/sharkdp/fd) +## Getting Started +`git clone https://github.com/saeedafzal/neovim-config.git ~/.config/nvim --recursive` diff --git a/init.lua b/init.lua index d221ebc..019c0de 100644 --- a/init.lua +++ b/init.lua @@ -1,25 +1,5 @@ -- Core configuration require "core" --- Bootstrap lazy.nvim -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, - { "\nPress any key to exit..." }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end -end -vim.opt.rtp:prepend(lazypath) - --- Load plugins -require("lazy").setup("plugins") - -- Theme require("theme_switcher").toggle() diff --git a/lua/core/autocmds.lua b/lua/core/autocmds.lua index ec210d2..0ae364f 100644 --- a/lua/core/autocmds.lua +++ b/lua/core/autocmds.lua @@ -10,11 +10,6 @@ api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, { command = "Tabs 4" }) -api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, { - pattern = { "*.ts", "*.tsx" }, - command = "compiler tsc" -}) - api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, { pattern = { "*.dart" }, callback = function() @@ -27,30 +22,3 @@ api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, { pattern = "*.md", command = "set conceallevel=3" }) - --- Markdown navigation -function navigate_markdown() - local line = vim.api.nvim_get_current_line() - local cursor_pos = vim.api.nvim_win_get_cursor(0) - local col = cursor_pos[2] - - local pattern = "%[%[([^%]]+%.md)%]%]" - local start_pos, end_pos, file = line:find(pattern) - - if start_pos and col >= start_pos - 1 and col <= end_pos then - if vim.fn.filereadable(file) == 1 then - vim.cmd('edit ' .. file) - else - print("File not found: " .. file) - end - else - print("No valid Markdown link under cursor.") - end -end - -api.nvim_create_autocmd("FileType", { - pattern = "markdown", - callback = function() - api.nvim_set_keymap("n", "gd", ":lua navigate_markdown()", {}) - end -}) diff --git a/lua/markdown_navigator/init.lua b/lua/markdown_navigator/init.lua deleted file mode 100644 index 001eb15..0000000 --- a/lua/markdown_navigator/init.lua +++ /dev/null @@ -1,31 +0,0 @@ -local M = {} - -function M.open() - local line = vim.api.nvim_get_current_line() - local cursor_pos = vim.api.nvim_win_get_cursor(0) - local col = cursor_pos[2] - - local pattern = "%[%[([^%]]+%.md)%]%]" - local start_pos, end_pos, file = line:find(pattern) - - if start_pos and col >= start_pos - 1 and col <= end_pos then - if vim.fn.filereadable(file) == 1 then - vim.cmd('edit ' .. file) - else - print("File not found: " .. file) - end - else - print("No valid Markdown link under cursor.") - end -end - -function M.setup() - vim.api.nvim_create_autocmd("FileType", { - pattern = "markdown", - callback = function() - vim.api.nvim_set_keymap("n", "gd", ":lua require('markdown_navigator').open()", {}) - end - }) -end - -return M diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua deleted file mode 100644 index 2e2cc10..0000000 --- a/lua/plugins/init.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "wakatime/vim-wakatime" -} diff --git a/pack/vendor/start/vim-wakatime b/pack/vendor/start/vim-wakatime new file mode 160000 index 0000000..cf51327 --- /dev/null +++ b/pack/vendor/start/vim-wakatime @@ -0,0 +1 @@ +Subproject commit cf51327a9e08935569614d1cb24e779ee9f45519