Code Monkey home page Code Monkey logo

Comments (5)

bangedorrunt avatar bangedorrunt commented on September 16, 2024 1

I made a PR, please have a look

from tmux.nvim.

aserowy avatar aserowy commented on September 16, 2024 1

Merged it finally 🙃

from tmux.nvim.

aserowy avatar aserowy commented on September 16, 2024

heho,

ty for the idea. need some time to get this done. if you want it now, please file a pr :)

regards
Alexander

from tmux.nvim.

bangedorrunt avatar bangedorrunt commented on September 16, 2024

heho,

ty for the idea. need some time to get this done. if you want it now, please file a pr :)

regards Alexander

@aserowy

I wanna give it a go, but I'm new to Lua so please help me out.
Here is my current implementation. However it doesn't work as expected.

If I called require('tmux').setup {} it results in error

Screen Shot 2022-09-14 at 8 19 00 pm

diff --git a/lua/tmux/init.lua b/lua/tmux/init.lua
index c40dc66..afab83a 100644
--- a/lua/tmux/init.lua
+++ b/lua/tmux/init.lua
@@ -5,6 +5,20 @@ local navigation = require("tmux.navigation")
 local resize = require("tmux.resize")
 local tmux = require("tmux.wrapper.tmux")
 
+local options = {
+    copy_sync = {
+        enable = true,
+    },
+    navigation = {
+        enable_default_keybindings = true,
+    },
+    resize = {
+        enable_default_keybindings = true,
+    },
+}
+
+local logging = {}
+
 local M = {
     move_left = navigation.to_left,
     move_bottom = navigation.to_bottom,
@@ -20,23 +34,31 @@ local M = {
     resize_right = resize.to_right,
 }
 
-function M.setup(options, logging)
-    log.setup()
+log.setup()
 
-    log.debug("setup tmux wrapper")
-    tmux.setup()
+log.debug("setup tmux wrapper")
+tmux.setup()
 
-    log.debug("setup config")
-    config.setup(options, logging)
+log.debug("setup config")
 
-    log.debug("setup copy")
-    copy.setup()
+function M.setup(options_, logging_)
+    if options_ == nil or options_ == "" then
+        return
+    end
+    for k, v in pairs(options_) do
+        options[k] = v
+    end
+    logging = logging_ or {}
+end
 
-    log.debug("setup navigate")
-    navigation.setup()
+config.setup(options, {})
 
-    log.debug("setup resize")
-    resize.setup()
-end
+log.debug("setup copy")
+copy.setup()
+
+log.debug("setup navigate")
+navigation.setup()
 
+log.debug("setup resize")
+resize.setup()
return M

from tmux.nvim.

bangedorrunt avatar bangedorrunt commented on September 16, 2024

Thank you!

from tmux.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.