Skip to content

Commit

Permalink
adding restructure for lazy
Browse files Browse the repository at this point in the history
  • Loading branch information
TechDufus committed Dec 14, 2023
1 parent 1930581 commit f722bbc
Show file tree
Hide file tree
Showing 25 changed files with 75 additions and 66 deletions.
44 changes: 44 additions & 0 deletions roles/neovim/files/init.lua
Original file line number Diff line number Diff line change
@@ -1 +1,45 @@
require('techdufus')

-- Automatically install lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)


-- Install your plugins here
require('lazy').setup('plugins', {
install = {
missing = true,
},
checker = {
enabled = true,
notify = false,
},
change_detection = {
enabled = true,
notify = false,
},
performance = {
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})


File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ return {
local icons = require('techdufus.core.icons')
require("neo-tree").setup({
close_if_last_window = false,
popup_border_style = "single",
popup_border_style = "rounded",
enable_git_status = true,
enable_modified_markers = true,
enable_diagnostics = false,
update_cwd = true,
enable_diagnostics = true,
sort_case_insensitive = true,
default_component_configs = {
container = {
enable_character_fade = true,
},
indent = {
with_markers = true,
with_expanders = true,
Expand Down Expand Up @@ -56,7 +60,7 @@ return {
},
},
window = {
position = "left",
position = "float",
width = 35,
mappings = {
["<Backspace>"] = {
Expand Down Expand Up @@ -85,24 +89,7 @@ return {
enabled = true
},
},
event_handlers = {
{
event = "neo_tree_window_after_open",
handler = function(args)
if args.position == "left" or args.position == "right" then
vim.cmd("wincmd =")
end
end,
},
{
event = "neo_tree_window_after_close",
handler = function(args)
if args.position == "left" or args.position == "right" then
vim.cmd("wincmd =")
end
end,
},
},
event_handlers = { },
})
end,
}
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion roles/neovim/files/lua/techdufus/core/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ keymap(normal_mode, "<C-l>", "<C-w>l", opts)

keymap(normal_mode, ";", ":", opts)

keymap(normal_mode, "<leader>w", ":NvimTreeFocus<cr>", opts)
keymap(normal_mode, "<leader>b", ":Telescope buffers<cr>", opts)
-- Unhilight search --
keymap(normal_mode, "<leader>chl", ":nohl<cr>", opts)

Expand Down
1 change: 0 additions & 1 deletion roles/neovim/files/lua/techdufus/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ vim.g.loaded = 1
vim.g.loaded_netrwPlugin = 1

require('techdufus.core')
require('techdufus.plugins-setup')
41 changes: 0 additions & 41 deletions roles/neovim/files/lua/techdufus/plugins-setup.lua

This file was deleted.

22 changes: 21 additions & 1 deletion roles/neovim/tasks/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,25 @@
ansible.builtin.copy:
dest: "{{ ansible_user_dir }}/.config/nvim/lua"
src: "lua/"
mode: 0644
mode: "0644"

- name: "Neovim | Get config files"
ansible.builtin.find:
paths: "{{ ansible_role_path }}/files/lua"
file_type: file
register: config_files

- name: Find all remote files
ansible.builtin.find:
paths: "{{ ansible_user_dir }}/.config/nvim/lua"
file_type: file
register: existing

- name: "Neovim | Delete any leftover files"
ansible.builtin.file:
path: {{ item.path }}
state: absent
when: item.path|basename not in config_files.files|map(attribute='path')|list
with_items: "{{existing.files|default([ ])}}"
register: removed

2 changes: 1 addition & 1 deletion roles/system/tasks/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ansible.builtin.apt:
update_cache: true
upgrade: "yes"
state: latest
state: "latest"
autoremove: true
autoclean: true
become: true
Expand Down

0 comments on commit f722bbc

Please sign in to comment.