summaryrefslogtreecommitdiff
path: root/README.md
blob: fe66a5d2fb77f5a9b46a5e3d6d6c2d10b05dc5a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<div align="center">

<img alt="A parachute dropping a crate" src="assets/logo.png" width="250px" />

# dropship.nvim

Your neovim tabs, dropshipped into your projects

</div>


# How it works

1. Configure the plugin with either a table containing drop location
   or a path to a lua file that returns that.
2. Setup keybinds you might want to use dropship with
3. Profit!

**Using a pre-baked list of drop-locations**:

```lua
{
  "ChausseBenjamin/dropship.nvim",
  dependencies = "nvim-telescope/telescope.nvim",
  opts = {
  drop_locations = {
    { "Projects", "~/Workspace" },
    { "Neovim Config", "~/.config/nvim" },
    { "University", "~/Documents/school/university/current_semester" },
  },
  },
  keys = {
    {
      "<leader>dt",
      function()
        require("dropship").dropship_newtab()
      end,
      mode = "n",
      desc = "[D]ropship in a new [T]ab",
    },
    {
      "<leader>dh",
      function()
        require("dropship").dropship_current()
      end,
      mode = "n",
      desc = "[D]ropship right [H]ere",
    },
  },
  cmd = {
  "Dropship",
  "DropshipNewTab",
  }
}
```


**Using a lua file for drop-locations**:

In order to have a single source of truth for my shortcuts, I have a script
that generates shortcuts for most of my apps [in my dotfiles][1]. This type of
solution makes sense for me to keep all my shortcuts in sync.

```lua
{
  "ChausseBenjamin/dropship.nvim",
  dependencies = "nvim-telescope/telescope.nvim",
  opts = {
  drop_locations = "~/.cache/droplist.lua"
  },
  -- Same as above for the rest...
}
```

And the `droplist.lua` would then look like the following:

```lua
return {
  { "Projects", "~/Workspace" },
  { "Neovim Config", "~/.config/nvim" },
  { "University", "~/Documents/school/university/current_semester" },
}
```


[1]: https://github.com/ChausseBenjamin/dotfiles/blob/master/.local/bin/shortcutgen