From ec14231679cf988ad955d73c9fb3493aae30f380 Mon Sep 17 00:00:00 2001 From: jakobst1n Date: Tue, 29 Oct 2024 15:30:21 +0100 Subject: Change basic.lua to m4 file --- .gitignore | 1 + Common/nvim/lua/basic.lua | 35 ----------------------------------- Common/nvim/lua/basic.lua.m4 | 38 ++++++++++++++++++++++++++++++++++++++ Makefile.m4 | 7 +++++-- 4 files changed, 44 insertions(+), 37 deletions(-) delete mode 100755 Common/nvim/lua/basic.lua create mode 100755 Common/nvim/lua/basic.lua.m4 diff --git a/.gitignore b/.gitignore index 640f120..cca9fc5 100644 --- a/.gitignore +++ b/.gitignore @@ -79,6 +79,7 @@ system.m4 # Generated Common/zshrc Common/bashrc +Common/nvim/lua/basic.lua linux/tmux.conf linux/qtile/config/config.py linux/sway/config diff --git a/Common/nvim/lua/basic.lua b/Common/nvim/lua/basic.lua deleted file mode 100755 index 47a7ab6..0000000 --- a/Common/nvim/lua/basic.lua +++ /dev/null @@ -1,35 +0,0 @@ -vim.opt.formatoptions:remove("t") -vim.opt.path:append("**") -vim.g.netrw_banner = 0 -vim.opt.wildignore = '*.o,*~,*.pyc,*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store' -vim.opt.smartcase = true -vim.opt.showmatch = true -vim.opt.swapfile = false -vim.opt.smartindent = true -vim.opt.mouse = "" - --- Default to the "modern normal" -vim.opt.expandtab = true -vim.opt.shiftwidth = 4 -vim.opt.tabstop = 4 -vim.opt.softtabstop = 4 - --- Disable highlight when is pressed -vim.api.nvim_set_keymap('n', '', ':noh', { noremap = true, silent = true }) - --- Tab commands -vim.api.nvim_set_keymap('n', 'tp', ':tabprevious', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', 'tn', ':tabnext', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', 'tc', ':tabnew', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', 'tx', ':tabclose', { noremap = true, silent = true }) - --- Return to last edit position when opening files -vim.cmd [[ - au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif -]] - --- Colorscheme -vim.cmd [[ colorscheme bw ]] -vim.opt.background = "light" --- No idea why, preview in fzf does at least work extremely porly without this -vim.cmd [[ let $BAT_THEME = 'gruvbox-light' ]] diff --git a/Common/nvim/lua/basic.lua.m4 b/Common/nvim/lua/basic.lua.m4 new file mode 100755 index 0000000..70d78cc --- /dev/null +++ b/Common/nvim/lua/basic.lua.m4 @@ -0,0 +1,38 @@ +vim.opt.formatoptions:remove("t") +vim.opt.path:append("**") +vim.g.netrw_banner = 0 +vim.opt.wildignore = '*.o,*~,*.pyc,*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store' +vim.opt.smartcase = true +vim.opt.showmatch = true +vim.opt.swapfile = false +vim.opt.smartindent = true +vim.opt.mouse = "" + +-- Default to the "modern normal" +vim.opt.expandtab = true +vim.opt.shiftwidth = 4 +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 + +-- Disable highlight when is pressed +vim.api.nvim_set_keymap('n', '', ':noh', { noremap = true, silent = true }) + +-- Tab commands +vim.api.nvim_set_keymap('n', 'tp', ':tabprevious', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', 'tn', ':tabnext', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', 'tc', ':tabnew', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', 'tx', ':tabclose', { noremap = true, silent = true }) + +-- Return to last edit position when opening files +vim.cmd [[ + au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif +]] + +-- Colorscheme +vim.cmd [[ colorscheme bw ]] +vim.opt.background = "light" +-- No idea why, preview in fzf does at least work extremely porly without this +vim.cmd [[ let $BAT_THEME = 'gruvbox-light' ]] +m4_ifelse(DT_DOTFILES_TYPE, `remote', `m4_dnl +vim.opt.termguicolors = true +')m4_dnl diff --git a/Makefile.m4 b/Makefile.m4 index f59ffc8..884f663 100644 --- a/Makefile.m4 +++ b/Makefile.m4 @@ -182,7 +182,10 @@ m4_ifelse(DT_NEOVIM, `yes', `m4_dnl git -C /tmp/neovim checkout tags/v0.10.0 (cd /tmp/neovim && sudo make install) -$(HOME_DIR)/.config/nvim: /usr/local/bin/nvim +Common/nvim/lua/basic.lua: Common/nvim/lua/basic.lua.m4 ${M4_COMMON_DEPS} + $(call M4_EXEC) + +$(HOME_DIR)/.config/nvim: Common/nvim/lua/basic.lua /usr/local/bin/nvim $(call create_symlink,$(SRC_DIR)/Common/nvim,$(HOME_DIR)/.config/nvim) ')m4_dnl @@ -221,7 +224,7 @@ m4_ifelse(DT_GREETD_TUIGREET, `yes', `greetd',) m4_dnl m4_ifelse(DT_TLP, `yes', `tlp',) m4_dnl m4_dnl m4_ifelse(DT_SWAY, `yes', `sway swayidle physlock blueman network-manager-gnome wob wlogout wofi brightnessctl clipman xwayland seahorse fcitx5',) m4_dnl -m4_ifelse(DT_NEOVIM, `yes', `cmake gettext fzf',) m4_dnl +m4_ifelse(DT_NEOVIM, `yes', `cmake gettext',) m4_dnl m4_ifelse(DT_ALACRITTY, `yes', `libfontconfig1-dev pkg-config',) m4_dnl -- cgit v1.2.3