Below are functions that can be used to switch to next or previus buffer in the same major mode
(defun buffer-same-mode (change-buffer-fun)
(let ((current-mode major-mode)
(next-mode nil))
(while (not (eq next-mode current-mode))
(funcall change-buffer-fun)
(setq next-mode major-mode))))
(defun previous-buffer-same-mode ()
(interactive)
(buffer-same-mode #'previous-buffer))
(defun next-buffer-same-mode ()
(interactive)
(buffer-same-mode #'next-buffer))
In my init file I have bind those functions to CTRL+TAB and CTRL+ALT+TAB which was not set by default.
(global-set-key [C-M-tab] 'previous-buffer-same-mode) (global-set-key [C-tab] 'next-buffer-same-mode)

