add sway config

This commit is contained in:
Nydragon 2023-12-20 12:20:31 +09:00
parent 2ec2a1f726
commit a4af16f614
2 changed files with 28 additions and 16 deletions

View file

@ -1,21 +1,26 @@
vim.g.loaded_netrw = 1 vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1 vim.g.loaded_netrwPlugin = 1
require("nvim-tree").setup() require("nvim-tree").setup({
filters = {
dotfiles = false,
git_ignored = false,
},
})
local function open_nvim_tree(data) local function open_nvim_tree(data)
-- buffer is a real file on the disk -- buffer is a real file on the disk
local real_file = vim.fn.filereadable(data.file) == 1 local real_file = vim.fn.filereadable(data.file) == 1
-- buffer is a [No Name] -- buffer is a [No Name]
local no_name = data.file == "" and vim.bo[data.buf].buftype == "" local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
if not real_file and not no_name then if not real_file and not no_name then
return return
end end
-- open the tree, find the file but don't focus it -- open the tree, find the file but don't focus it
require("nvim-tree.api").tree.toggle({ focus = false, find_file = true, }) require("nvim-tree.api").tree.toggle({ focus = false, find_file = true })
end end
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })

View file

@ -1,8 +1,15 @@
require('telescope').setup() require("telescope").setup({
pickers = {
find_files = {
-- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d.
find_command = { "rg", "--files", "--hidden", "--no-ignore", "--glob", "!**/.git/*" },
},
},
})
local builtin = require('telescope.builtin') local builtin = require("telescope.builtin")
vim.keymap.set('n', '<leader>ff', builtin.find_files, {}) vim.keymap.set("n", "<leader>ff", builtin.find_files, {})
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {}) vim.keymap.set("n", "<leader>fg", builtin.live_grep, {})
vim.keymap.set('n', '<leader>fb', builtin.buffers, {}) vim.keymap.set("n", "<leader>fb", builtin.buffers, {})
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {}) vim.keymap.set("n", "<leader>fh", builtin.help_tags, {})