diff --git a/files/dotfiles/nvim/lua/user/packer.lua b/files/dotfiles/nvim/lua/user/packer.lua index fc55375..fe55854 100644 --- a/files/dotfiles/nvim/lua/user/packer.lua +++ b/files/dotfiles/nvim/lua/user/packer.lua @@ -1,3 +1,5 @@ +local treesitter_extention_exists, _ = pcall(require, 'user.packer_extention_treesitter') + return require("packer").startup(function(use) -- Packer can manage itself use 'wbthomason/packer.nvim' @@ -60,10 +62,12 @@ return require("packer").startup(function(use) requires = { { 'nvim-lua/plenary.nvim' } } } - use { - 'nvim-treesitter/nvim-treesitter', - run = ':TSUpdate' - } + if treesitter_extention_exists then + use { + 'nvim-treesitter/nvim-treesitter', + run = ':TSUpdate' + } + end -- Beacon use 'danilamihailov/beacon.nvim' diff --git a/playbooks/workstation.yml b/playbooks/workstation.yml index 926375e..fde5e2a 100644 --- a/playbooks/workstation.yml +++ b/playbooks/workstation.yml @@ -5,6 +5,8 @@ theme: gruvbox # The running user running_user: "{{ ansible_user_id }}" + # for nvim - workstation should install extentions + nvim_extention_treesitter: true roles: - base - fonts diff --git a/roles/vim_user/defaults/main.yml b/roles/vim_user/defaults/main.yml new file mode 100644 index 0000000..73f4dad --- /dev/null +++ b/roles/vim_user/defaults/main.yml @@ -0,0 +1,2 @@ +--- +nvim_extention_treesitter: false diff --git a/roles/vim_user/tasks/main.yml b/roles/vim_user/tasks/main.yml index b0ca40c..939cabe 100644 --- a/roles/vim_user/tasks/main.yml +++ b/roles/vim_user/tasks/main.yml @@ -22,3 +22,12 @@ copy: src: dotfiles/nvim/ dest: ~/.config/nvim/ + +- name: Debug extentions + debug: + msg: "TreeSitter: {{ nvim_extention_treesitter }}" + +- name: nvim extention treesitter + shell: | + echo "return {}" > ~/.config/nvim/lua/user/packer_extention_treesitter.lua + when: nvim_extention_treesitter