sha5010 / vim.xlam

Vim experience in Excel: An add-in that brings Vim’s key bindings to Excel, enhancing navigation and efficiency.
MIT License
68 stars 6 forks source link

Custom config help #42

Open zhengye96 opened 4 months ago

zhengye96 commented 4 months ago

Dear author, I have placed the _vimxlamrc file within the same directory with vim.xlam. After relaunch excel, nothing has changed.

vincentroue commented 4 months ago

Hello,

Same thing for me, I tried 2 times but nothing changes. So I changed the shortcuts directly in the command module of visual basics Is it still in development? the addin is incredible Honesty, but suffers from repeated bugs.

zhengye96 commented 4 months ago

Thanks for the pointer Vincent. Yeah this is really speeding up my work flow.

sha5010 commented 4 months ago

@zhengye96 @vincentroue

Thank you for using vim.xlam and contacting me. Sorry for the delay in confirming.

Can you please share the details of the config? I would like to identify the cause of the issue.

sdys-box commented 4 months ago

This may not be the cause of this issue, but I think the Dir() function does not handle some Unicode characters correctly. (Same for Open statements?).

sdys-box commented 3 months ago

英語では無理なので日本語で失礼いたします。 Windows ローカルユーザー"VincentRoué"を作成し、そのユーザーでExcelを起動しました。 すると Dir(ThisWorkbook.Path & "\_vimxlamrc" ) が vbNullStringを返し、_vimxlamrcを読み込みませんでした。 (Windows 10 64bit、Office 2007 32bit日本語版でテスト) Dir関数が「é」(アクセント記号?)を認識しないようです。 Dir()の替わりにFileSystemObjectのFileExistsメソッドを使うか、WindowsAPIのPathFileExists関数を使うのはいかがでしょうか。

I created a Windows local user "Vincent Roué" and started Excel as that user. Then Dir(ThisWorkbook.Path & "\_vimxlamrc" ) returned vbNullString and did not load _vimxlamrc. (Tested on Windows 10 64bit, Office 2007 32bit Japanese version) It seems like the Dir function doesn't recognize the "é" (accent mark?). Instead of Dir(), why not use FileSystemObject's FileExists method or Windows API's PathFileExists function?

zhengye96 commented 3 months ago

Reply conversation sending to Sha

Dear Sha,   Sorry for the late reply. I have been traveling and didn't get a chance to reply until now. I can't upload the file directly here, please let me know if you need further reference. I can direct message you the files if needed. The errors might be due to my limited programming knowledge. After further experience, I have realized that there are a few sections that are a bit buggy.  

  1. When I am in visual line mode and go up or down using and within a predefined table, sometimes all the information in the workbook wiggles during the line change. (The behavior seems like the work sheet moved to the left, then snapped back to the original area where the selected cell is. Though it is not functionally breaking, it is a bit distracting from time to time )  
  2. I also have issues when trying to unhide columns. (After highlighting the previous and after column and press the unhide command , there is nothing happened)  
  3.   Suggestions:   The / and ? functions work by default. However, users need to disable / defult behavior. This way, it won't conflict with the script. (Perhaps include this configuration change in the Readme, so that users can configure it right away after installation.)   Month to month, I work on a table that requires cross-referencing between columns and rows, inputting values at the intersections of cells. I don't know how difficult this would be to implement, but a special find feature to get me directly to the intersections of cells might significantly increase my productivity. ( Currently, I only use </> to first get to the column, then <:> to get to the correct row.)   From my limited knowledge, I am also aware that Vim has the ability to record key stroke sequences. If there is such a feature that allows users to record key stroke sequences, it might make it much easier to set up tables or complete tedious tasks.   From a visual perspective, I don't know if it is possible to have relative column and row to be displayed. (It is not a must have requirement.)

sha5010 commented 3 months ago

@sdys-box 検証までしていただいてありがとうございます。なるほど、 Dir() だとうまく読み込めない場合があるんですね。考えていませんでした。

ご提案いただいた方法で修正を試みたいと思います。ただ最近なかなか時間が取れず、少し遅れてしまうかもしれません。ご不便をおかけします。

Thank you for verifying it. I see, there are cases where Dir() doesn’t obtain the path properly. I hadn’t considered that.

I will try to fix it using the method you suggested. However, I haven’t had much time lately, so it might take a little longer. I apologize for any inconvenience.

sha5010 commented 3 months ago

@zhengye96 I will answer in order.

  1. all the information in the workbook wiggles during the line change

If my understanding of English is correct, this is by design. In visual mode, internally, when the cell selection position changes, the range of the starting cell and the selected cell is reselected. At this time, the screen may flicker for a moment. I have tried methods to reduce screen flicker, but the movement becomes sluggish each time the cell position is changed, so I gave up on implementing it.

  1. I also have issues when trying to unhide columns.

I am instructing to press Ctrl+Shift+0, but it doesn't seem to work well. If you know of a shortcut key that works, please let me know.

There is nothing, but is there anything else?

Perhaps include this configuration change in the Readme

That's right! I will try to include it in the next update. I'm not very good at English, so if you have a recommended way of writing, please let me know. (If not, that's okay)

a special find feature to get me directly to the intersections of cells

The function to warp to a specific cell is assigned to W. For example, if you want to move to cell G15, you can move by typing Wg15<Enter>.

the ability to record key stroke sequences ... that allows users to record key stroke sequences

I would like to implement this as well, but I think it is very difficult. Also, due to the nature of VBA, the undo function cannot be used, so the point that it cannot be restored if it fails is fatal.

relative column and row to be displayed

Sorry, I didn't quite understand, so could you please explain in more detail?

sdys-box commented 3 months ago

1つのissueに雑々と書いてよいのかどうか・・・

Dir()の件、お手すきのときでお願いします。 私はReadOnlyユーザーなので、やる気が出たらプルリクの出し方を勉強してみようかと思います。

"unhide columns"の件はSelection.EntireColumns.Hidden = falseでいかがでしょうか。 あえてCtrl+Shift+0にしているかもしれませんが。

"intersections of cells"の件 行見出しと列見出しを検索してクロスするセルに移動したいということであれば、 「列見出しを検索 → VisualMode → 行見出しを検索 → 選択範囲の右下隅へ移動」 のような操作ができればよいのかなと思います。 どこまで要望に応えるべきかは分からないですが。

zhengye96 commented 3 months ago
  1. Thank you for the detailed updated and insight, this help me to understand the process behind the movement. I don't think it is a big deal for usability.

  2. So I changed my scope of view and found that it is not the vim.xlam implementation is not working, but windows setting itself will prevent the key trigger Ctrl+Shift. I have found an article and disable the settings, the command worked.

If possible please help update in the Readme?

Explanation and solution: https://superuser.com/questions/1455762/ctrl-shift-number-key-combination-has-stopped-working-for-a-few-numbers

Perhaps include this configuration change in the Readme

The instructions as follow for the latest Microsoft Excel 365: Under File-> Select Options-> On the left panel Select Advanced->On the right side window scroll all the way down to the section called Lotus Compatibility-> Empty the input box after the description 'Microsoft Excel menu key:' -> Keep the box empty and click okay.

relative column and row to be displayed I don't think it is a must have feature. To be honest, I think by using the command with <:> is way more precise after longer period of use.

Conclusion: Thank you so much for creating such useful and efficient product! In the previous post I was still in the learn phase and trying to get comfortable using this tool.

Now that I have used it for few weeks, I start to get a lot of the concept and design behind it.

I am sending my deepest gratitude and prase across the pacific ocean!

sha5010 commented 2 months ago

@zhengye96 @vincentroue Sorry for the delayed response.

I’ve updated the code to use the FileExists method of the FileSystemObject. I've released a new build under the nightly tag. Could you please test it and see if the configuration file is correctly loaded now?

sha5010 commented 2 months ago

@sdys-box

"unhide columns"の件はSelection.EntireColumns.Hidden = falseでいかがでしょうか。 あえてCtrl+Shift+0にしているかもしれませんが。

これについては意図的にキー送信により実現するようにしています。 VBAから直接実行してしまうと元に戻す機能が使えなくなってしまうため、極力可能なものはキー送信で実装しています。

Ctrl+Shift+0 だとうまくいかない場合は認識していたのですが、こちらはWindows側の設定変更が必要なので、別の方法で対処しようと思います。 代わりに Alt+H, O, U, L を順に押すことで、同じ機能を実行できるようにしてみました。 Excel 2013でしか検証できていないですが、もしこれでは機能しない場合は教えていただけると幸いです。

@zhengye96

  1. So I changed my scope of view and found that it is not the vim.xlam implementation is not working, but windows setting itself will prevent the key trigger Ctrl+Shift. I have found an article and disable the settings, the command worked.

If possible please help update in the Readme?

Thank you for looking into the cause.

Since this requires changes to the Windows settings, I addressed it using a different method. Instead, I’ve tried setting it up so that you can execute the same function by pressing Alt+H, O, U, L in sequence. I’ve only tested this in Excel 2013, so if it doesn’t work for you, please let me know.

The instructions as follow for the latest Microsoft Excel 365:

Thank you for the wonderful description! I used it as a reference and included it in the README.

sdys-box commented 2 months ago

Windows 10 64bit、Office 2007 32bit日本語版でnightly buildを試しました。

"unhide columns"は動作しました。

以前_vimxlamrcが読めなかったユーザーでもテストしました。 FileExistsは正常に動いたようですが、ファイルOpenのところで実行時エラー76「パスが見つかりません」が出ました。 OpenもFileSystemObjectなどでの書き換えが必要と思われます。