diff --git a/config.ini b/config.ini index 6f33b43..8057322 100644 --- a/config.ini +++ b/config.ini @@ -65,7 +65,6 @@ files: # This needs to be run, but it's really annoying when you run the installer # from within Vim because it tries to do this recursive Vim thing that does not # work, so I'd rather just run it by hand. -# [run vim-plugins] when: host.has('vim') cmd: vim +PlugInstall +qall @@ -119,10 +118,6 @@ files: .screenrc when: host.has('tmux') files: .tmux.conf -# [home posix-nvim] -# when: host.has('nvim') and not host.is_windows -# files: nvim/init.vim > .config/nvim/init.vim - [home wsl] when: host.is_wsl files: scripts/winmode > bin/winmode diff --git a/nvim/after/plugin/colors.lua b/nvim/after/plugin/colors.lua index 399683e..7aaf00f 100644 --- a/nvim/after/plugin/colors.lua +++ b/nvim/after/plugin/colors.lua @@ -1,15 +1,17 @@ print("Setting up colors") -rose_pine = packer_plugins["rose-pine"] -if rose_pine then - print("Rose Pine is known") - if rose_pine.loaded then - print("Using Rose Pine colorscheme") - vim.cmd.colorscheme("rose-pine") - -- vim.cmd("colorscheme rose-pine") - else - print("Rose Pine is not loaded") - end -else - print("Rose Pine is not known") -end +vim.cmd.colorscheme("jellybeans") + +-- rose_pine = packer_plugins["rose-pine"] +-- if rose_pine then +-- print("Rose Pine is known") +-- if rose_pine.loaded then +-- print("Using Rose Pine colorscheme") +-- vim.cmd.colorscheme("rose-pine") +-- -- vim.cmd("colorscheme rose-pine") +-- else +-- print("Rose Pine is not loaded") +-- end +-- else +-- print("Rose Pine is not known") +-- end diff --git a/nvim/after/plugin/telescope.lua b/nvim/after/plugin/telescope.lua index d29f101..8a93426 100644 --- a/nvim/after/plugin/telescope.lua +++ b/nvim/after/plugin/telescope.lua @@ -1,2 +1,19 @@ print("After Telescope") + +local telescope = require('telescope') local builtin = require('telescope.builtin') + +telescope.setup({ + defaults = { + file_ignore_patterns = { + "__pycache__", + }, + preview = { + treesitter = { + enable = { + 'python', + } + } + } + }, +}) diff --git a/nvim/lua/etc.lua b/nvim/lua/etc.lua new file mode 100644 index 0000000..c8badcb --- /dev/null +++ b/nvim/lua/etc.lua @@ -0,0 +1,29 @@ +print("Loading up etc definitions") +local M = {} + +local telescope = require("telescope.builtin") + +-- cache directory checks for great speed +local is_inside_work_tree = {} + + +M.project_files = function() + local opts = {} + + local cwd = vim.fn.getcwd() + + if is_inside_work_tree[cwd] == nil then + -- The directory has not been checked + vim.fn.system("git rev-parse --is-inside-work-tree") + -- Add the result to our cache + is_inside_work_tree[cwd] = vim.v.shell_error == 0 + end + + if is_inside_work_tree[cwd] then + telescope.git_files(opts) + else + telescope.find_files(opts) + end +end + +return M diff --git a/nvim/lua/keys.lua b/nvim/lua/keys.lua index 393221f..d0283fe 100644 --- a/nvim/lua/keys.lua +++ b/nvim/lua/keys.lua @@ -1,7 +1,8 @@ print("Loading key mappings") local telescope = require('telescope.builtin') -vim.keymap.set('n', '', telescope.find_files, {}) +local etc = require("etc") +vim.keymap.set('n', '', etc.project_files, {}) -- vim.keymap.set("v", "J", ":m '>+1gv=gv") -- vim.keymap.set("v", "K", ":m '>-2gv=gv") diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index def9985..50554fd 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -24,8 +24,9 @@ return require('packer').startup(function(use) -- lets you look at parse trees use { 'nvim-treesitter/playground' } - -- it's a colorscheme + -- colorschemes use { "rose-pine/neovim", as = "rose-pine" } + use { "nanotech/jellybeans.vim", as = "jellybeans" } -- hmmmm try this? -- https://github.com/ThePrimeagen/harpoon/tree/harpoon2